I’ve installed nginx and I try to run wordpress on it.
Everything works fine, except for permalinks.
Here is the vhost-file I’m using:
server {
listen 123456:80;
server_name my-domain.com;
if ($host ~* www.(.*)) {
set $wwwless $1;
rewrite ^(.*)$ $scheme://$wwwless$1 permanent;
}
root /var/www/my-folder;
index index.php;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
(I’ve replaced critical data in the above code with my-domain.com, my-folder and the ip 123456.)
index.php, the admin-panel and using the standard links (…/?p=123) work finde. If I enable some of the permalinks, index.php and the admin-panel still work. But if I try to open another site of the wordpress blog, my browser downloads the index.php 🙁
Try something like this for the .php location config:
Here’s my wordpress config modified to suit you.
you can try this vhost file
}