version 2.0 cannot run in nginx + php
toohamster opened this issue · 1 comments
toohamster commented
toohamster commented
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
#
server {
listen 80;
listen [::]:80;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /home/pi/deploys/linux-dash/app;
# Add index.php to the list if you are using PHP
index index.php index.html;
server_name dash.pi.haiwai;
# Cache static files for as long as possible
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public,must-revalidate, proxy-revalidate";
}
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
try_files $uri $uri/ /server/index.php?$args;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
must add line fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;