Everything was working fine, but I did a lot of modifications and then I could get only a blank page.
It was a fresh install of NGINX so I decided to delete files in /etc/nginx
and to reinstall it.
apt-get purge nginx nginx-common nginx-full
apt-get install nginx nginx-common nginx-full
Now PHP files won't load and strangely I can't access the file 'test.html' which is in the document root directory (/usr/share/nginx/html).
nginx version: 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;
}
It's running on port 88 and I can access my NGINX web server default page by going to http://1.2.3.4:88
, but if I try http://1.2.3.4:88/test.html
I get "404 Not Found".
Directory listing of document root:
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*
And http://1.2.3.4:88/index.php
opens a downloaded dialog box, instead of being displayed.
And I have the following in my /etc/php5/fpm/php.ini:
cgi.fix_pathinfo=0
I haven't modified /etc/nginx/nginx.conf
.
I have found a lot of discussions on NGINX with downloading php files and I tried a lot of suggestions but I am still stuck and don't know what to do.