Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - sharif779

#1
I want to change lighttpd to nginx as default web server. I have already installed and changed configuration in nginx server like lighttpd but api and ui routing is not working.
Here is my changed code for nginx configuration
server {
listen 80;

server_name _;

root /usr/local/www;
index index.php index.html;
        location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
       
        location /ui/{
    alias /usr/local/opnsense/www/;
    try_files $uri $uri/ /ui//ui/index.php?_url=$uri&$args;
    location ~ /ui/.+\.php$ {
                include fastcgi_params;
                fastcgi_buffers 256 4k;
                fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            }
        }

location /api/{
    alias /usr/local/opnsense/www/;
    try_files $uri $uri/ /api//api/api.php?_url=$uri&$args;
    location ~ /api/.+\.php$ {
                include fastcgi_params;
                fastcgi_buffers 256 4k;
                fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            }
        }

        location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
    }
}
   
After changing config api response is
{
    "message": "controller OPNsense\\Core\\Api\\IndexController not found",
    "status": 400
}

I have added IndexController though this controller was not in opnsense but it is not working at all.
Can you please help.It is needed to change web server .
#2
19.7 Legacy Series / Opnsense for debian
February 27, 2019, 12:51:42 PM
Is it possible to run opnsense in Debian environment though it is FreeBSD based.
#3
Dear all,
When I used get_interfaces_info() this function from interfaces.inc in my api controller then following error occurred
{"errorMessage":"[color=red]Error at /usr/local/etc/inc/interfaces.inc:4827 - Undefined index: status (errno=8)"}[/color] . But when I used same function on my static php page inside /usr/local/www/   there is no error occurred.

Is it possible that function inside api controller.If possible then how can I use it?
I am using 17.7 .