我已经尝试了互联网上几乎所有的方法。我在Nginx配置文件中更改了fastcgi超时,更改了FastCGI端口,禁用了Windows的ipv6 ...,但是仍然发生错误。当Nginx使用其他非80端口时,不会出现这样的错误。
这是Nginx的配置文件:
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
# Max value 16384
worker_connections 8192;
# Accept multiple connections
multi_accept on;
}
# Settings that affect all server blocks
http {
include php_processes.conf;
include mime.types;
default_type application/octet-stream;
access_log logs/access.log;
sendfile on;
keepalive_timeout 65;
ssl_session_timeout 10m;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1 SSLv3;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS;
ssl_prefer_server_ciphers on;
gzip on;
client_max_body_size 2048m;
server_tokens on;
server {
listen 80;
server_name localhost;
root /PATH/TO/DIR;
index index.php;
location ~ .*\.php(\/.*)*$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
php-cgi也正在监听127.0.0.1:9000。 我正在使用的Nginx和PHP环境是wnmp
附加: 没有任何东西占用端口80,并且当Nginx使用端口80时,可以正确显示纯html文件。