I upgraded my Nginx 1.4.6 to 1.6.2 using this guide.
I am running Ubuntu 14.04 and 2 WordPress based sites.
This is my sample config file for wp site:
server {
listen 80;
root /var/www/nspeaks;
index index.php index.html index.htm;
server_name nspeaks.com wwww.nspeaks.com;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
include /etc/nginx/wordpress_params.regular;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
The wordpress_params.regular file has this
# WordPress pretty URLs:
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?q=$1 last;
I am not sure what other changes were required. Please help.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Fixed it myself. Replaced
with
And restarted nginx. All’s well now.
Also noticed that HTML files are being served just fine. Its the PHP files that are shown up as blanks.