Ran into a 500 issue when running Nginx and WP together and setting pretty permalinks. I've been trying a bunch of different methods from Google but none seems to help.
Config -
server {
listen 80;
root /var/www/mydomain.com/public_html;
index index.php index.html index.htm;
server_name .mydomain.com;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
All files load perfectly well, and the pages work if using the default permalinks setting. Strange thing is, if I check the network log I first see a 200 OK being received, then immediately followed by a 500. Any ideas?
Edit: Setting to close as I'm switching to Apache instead. Will mark correct answer as it seems to have helped others.
try:
try_files $uri $uri/ /index.php?q=$uri&$args;
AND:
fastcgi_index /index.php;
(note the / )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With