NGINX不能访问html文件和下载php文件

一切工作正常,但我做了很多修改,然后我只能得到一个空白页。 这是一个新的NGINX安装,所以我决定删除/etc/nginx文件并重新安装。

 apt-get purge nginx nginx-common nginx-full apt-get install nginx nginx-common nginx-full 

现在PHP文件不会加载,奇怪的是我无法访问文档根目录(/ usr / share / nginx / html)中的文件“test.html”。

nginx版本:nginx / 1.10.3

 cat /etc/nginx/sites-available/default server { listen 88 default_server; root /usr/share/nginx/html; index index.php index.html; access_log /var/log/nginx/default-access_log; error_log /var/log/nginx/default-error_log; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { #try_files $uri =404; fastcgi_index index.php; fastcgi_pass php5-fpm-sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } cat /etc/nginx/conf.d/php5-fpm.conf upstream php5-fpm-sock { server unix:/var/run/php5-fpm.sock; } 

它运行在端口88上,我可以通过访问http://1.2.3.4:88来访问我的NGINX Web服务器默认页面,但是如果我尝试http://1.2.3.4:88/test.html我会得到“404不是find”。

文档根目录列表:

 root@Ubuntu-14LTS-NY1:~# ll /usr/share/nginx/html total 20 drwxr-xr-x 2 root root 4096 May 4 16:03 ./ drwxr-xr-x 4 root root 4096 May 4 16:02 ../ -rw-r--r-- 1 root root 612 Jan 31 10:01 index.html -rw-r--r-- 1 root root 20 May 4 15:54 index.php -rwxrwxrwx 1 www-data root 22 May 4 16:01 test.html* 

http://1.2.3.4:88/index.php打开一个下载的对话框,而不是显示。

我在/etc/php5/fpm/php.ini中有以下内容:

 cgi.fix_pathinfo=0 

我没有修改/etc/nginx/nginx.conf

我在NGINX上发现了很多关于下载php文件的讨论,我尝试了很多build议,但是我还是陷入了困境,不知道该怎么做。

我应该有检查nginx日志文件/var/log/nginx/error.log错误的reflection

我有error.log:

 2017/05/05 09:15:52 [emerg] 22587#22587: bind() to [::]:88 failed (98: Address already in use). 

所以我杀了2个nginx进程kill -9 PROCESSID ,它仍在运行,而我已经停止了nginx服务。

现在一切正常了:)