Nginx cannot parse the php page, status is 200, and there is nothing in the error log,
but the html page can be parsed smoothly.
cenos7 system version, Nginx version is 1.14. Basically all the methods on the Internet have been tried, but it is useless to add fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name to nginx.conf.
my nginx.conf content:
user root;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main "$remote_addr - $remote_user [$time_local] "$request" "
"$status $body_bytes_sent "$http_referer" "
""$http_user_agent" "$http_x_forwarded_for"";
access_log /var/log/nginx/access.log main;
sendfile on;
-sharptcp_nopush on;
keepalive_timeout 65;
-sharpgzip on;
include /etc/nginx/conf.d/*.conf;
}
server {
listen 8080;
server_name 127.0.0.1;
-sharpcharset koi8-r;
-sharpaccess_log /var/log/nginx/host.access.log main;
root /mnt/hgfs/WWW/ParallelForPhp_new/public;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
location / {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
-sharperror_page 404 /404.html;
-sharp redirect server error pages to the static page /50x.html
-sharp
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
-sharp proxy the PHP scripts to Apache listening on 127.0.0.1:80
-sharp
-sharplocation ~ \.php$ {
-sharp proxy_pass http://127.0.0.1;
-sharp}
-sharp pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
-sharp
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}