When starting Nginx and WP along with setting pretty permalinks, there is a 500 problem. I tried a bunch of different methods from Google, but no one helps.
Configuration -
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 fine, and pages work if you use the default permalink setting. It’s strange if I check the network log, I will first see the 200 OK that I received, and then immediately 500. Any ideas?
Edit: setting to close when I switch to Apache. Check the correct answer as it seems to have helped others.
source
share