My wordpress site has been working fine for sometime with nginx and wordpress. But for some reason it is now giving me a 404 error. I think this may be related to the quick-cache plugin which I recently updated. Although I'm not 100% sure about this.
To setup wp-nginx I following these instructions. So far I've done the following
- deleted my plugin directory
- removed reference to quick-cache from wp-config.php /wp-content folder
- checked my nginx config which is below
However after restarting I still get the same 404 error. Would anyone know what could be wrong..?
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
server_name mysite.com;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Best Answer
Your config is not okay.
Here is working WordPress config file.