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; }}
{ "message": "controller OPNsense\\Core\\Api\\IndexController not found", "status": 400}
location ~ \.php$ { fastcgi_pass unix:/var/run/php-webgui.socket; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; include fastcgi_params; } # Phalcon ui and api routing location @apirequest { root /usr/local/opnsense/www; include fastcgi_params; fastcgi_param QUERY_STRING &$query_string; fastcgi_param SCRIPT_FILENAME /usr/local/opnsense/www/api.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_intercept_errors off; fastcgi_pass unix:/var/run/php-webgui.socket; } location @guirequest { root /usr/local/opnsense/www; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param SCRIPT_FILENAME /usr/local/opnsense/www/index.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_intercept_errors off; fastcgi_pass unix:/var/run/php-webgui.socket; } location ~ ^/ui/(?<path>[^\?]+)(?<query>\?(.*))? { root /usr/local/opnsense/www; try_files /$path @guirequest; } location ~ ^/api/(?<path>[^\?]+)(?<query>\?(.*))?{ root /usr/local/opnsense/www; try_files /$path @apirequest; }
server { listen 80; server_name _; root /usr/local/www; #compress.cache-dir = "/tmp/lighttpdcompress/" gzip_types text/plain text/css text/xml text/javascript; #server.upload-dirs = ( "/root/", "/tmp/", "/var/" ) # server.max-request-size = 2097152 expires 50h; # Maximum idle time with nothing being written (php downloading) #fastcgi_read_timeout = 999 ## where to send error/access-messages to access_log syslog:server=127.0.0.1,facility=daemon; access_log /var/log/nginx/webgui.access.log; error_log syslog:server=127.0.0.1,facility=daemon; error_log /var/log/nginx/error.log debug; index index.php index.html index.htm default.htm; # mimetype mapping types { application/x-ns-proxy-autoconfig pad.dat; application/pdf pdf; application/pgp-signature sig; application/futuresplash spl; application/octet-stream class; application/postscript ps; application/x-bittorrent torrent; application/x-dvi dvi; application/x-gzip gz; application/x-ns-proxy-autoconfig pac; application/x-shockwave-flash swf; application/x-tgz tar.gz tgz; application/x-tar tar; application/zip zip; audio/mpeg mp3; audio/x-mpegurl m3u; audio/x-ms-wma wma; audio/x-ms-wax wax; audio/x-wav ogg; audio/x-wav wav; image/gif gif; image/jpeg jpg jpeg; image/png png; image/svg+xml svg; image/x-xbitmap xbm; image/x-xpixmap xpm; image/x-xwindowdump xwd; text/css css; text/html html htm; text/javascript js; text/plain asc; text/plain c; text/plain conf; text/plain text txt; text/xml dtd; text/xml xml; video/mpeg mpeg; video/mpeg mpg; video/quicktime mov qt; video/x-msvideo avi; video/x-ms-asf asf asx; video/x-ms-wmv wmv; application/x-bzip bz2; application/x-bzip-compressed-tar tbz tar.bz2; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; include fastcgi_params; } # Phalcon ui and api routing location @apirequest { root /usr/local/opnsense/www; include fastcgi_params; fastcgi_param QUERY_STRING &$query_string; fastcgi_param SCRIPT_FILENAME /usr/local/opnsense/www/api.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_intercept_errors off; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } location @guirequest { root /usr/local/opnsense/www; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param SCRIPT_FILENAME /usr/local/opnsense/www/index.php; fastcgi_param TLS-Cipher $ssl_cipher; fastcgi_param TLS-Protocol $ssl_protocol; fastcgi_param TLS-SNI-Host $ssl_server_name; fastcgi_intercept_errors off; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } location ~ ^/ui/(?<path>[^\?]+)(?<query>\?(.*))? { root /usr/local/opnsense/www; try_files /$path @guirequest; } location ~ ^/api/(?<path>[^\?]+)(?<query>\?(.*))?{ root /usr/local/opnsense/www; try_files /$path @apirequest; }}