Welcome! Log In Create A New Profile

Advanced

Convert from port to path

Posted by jhmiller 
Convert from port to path
August 04, 2014 07:09PM
Looking to convert this working conf

server {
server_name zoneminder-webgui;
root /usr/share/zoneminder;
index index.php;
autoindex off;
server_tokens off;
sendfile on;
large_client_header_buffers 4 32k;
error_log /var/log/nginx/zoneminder-webgui_error.log error;
access_log /var/log/nginx/zoneminder-webgui_access.log combined;

location /images/ {
alias /usr/share/zoneminder/images/;
}

location /cgi-bin/ {
proxy_pass http://127.0.0.1:4085;
}

location ~ \.php$ {
root /usr/share/zoneminder;
fastcgi_pass unix:/var/run/php5-fpm-zoneminder-webgui.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/share/zoneminder/$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /usr/share/zoneminder;
}

listen [::]:81 default_server ipv6only=off;
}

to something like this

location /zm/ {
alias /usr/share/zoneminder/;
index index.php;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-zoneminder-webgui.sock;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /usr/share/zoneminder/$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
include fastcgi_params;
}

location /zm/images/ {
root /var/cache/zoneminder/images/;
}

location /zm/cgi-bin/ {
proxy_pass http://127.0.0.1:4085;
}


location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
}
}

This does show the site but does not look to run the files in /zm/cgi-bin/

Thanks for looking.
Miller
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready