Thank you for this. I went back to a single file from http://piwigo.org/forum/viewtopic.php?pid=163083 and I added fastcgi_params.
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo service nginx restart
I see nginx worker in htop. (php-fpm7.0 is ok)
Website is only showing "error".
404 Not Found
nginx/1.10.1
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 512;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
tcp_nopush on;
types_hash_max_size 2048;
gzip on;
gzip_proxied any;
gzip_types text/plain /html text/css application/x-javascript;
gzip_disable "msie6";
uninitialized_variable_warn on;
server {
listen 80;
server_name localhost mysite.com www.mysite.com;
client_max_body_size 50m;
client_body_buffer_size 25m;
location / {
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/picture((/|$).*)$ /picture.php$1 last;
rewrite ^/index((/|$).*)$ /index.php$1 last;
rewrite ^/i((/|$).*)$ /i.php$1 last;
}
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files $script_name = 404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ ^/favicon.ico$ {
log_not_found off;
access_log off;
expires max;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# piwigo distribution files
location ~ ^/(README|doc)$ {
deny all;
}
# prevent direct acces to logs
location ~ ^/(_data/(|logs))/ {
deny all;
}
#error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root /var/www/nginx-default;
}
}
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo service nginx restart
I see nginx worker in htop. (php-fpm7.0 is ok)
Website is only showing "error".
404 Not Found
nginx/1.10.1
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 512;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
tcp_nopush on;
types_hash_max_size 2048;
gzip on;
gzip_proxied any;
gzip_types text/plain /html text/css application/x-javascript;
gzip_disable "msie6";
uninitialized_variable_warn on;
server {
listen 80;
server_name localhost mysite.com www.mysite.com;
client_max_body_size 50m;
client_body_buffer_size 25m;
location / {
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/picture((/|$).*)$ /picture.php$1 last;
rewrite ^/index((/|$).*)$ /index.php$1 last;
rewrite ^/i((/|$).*)$ /i.php$1 last;
}
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files $script_name = 404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ ^/favicon.ico$ {
log_not_found off;
access_log off;
expires max;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# piwigo distribution files
location ~ ^/(README|doc)$ {
deny all;
}
# prevent direct acces to logs
location ~ ^/(_data/(|logs))/ {
deny all;
}
#error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root /var/www/nginx-default;
}
}