I'm having a funny issue on my Wordpress lemp instalation. Here's the thing:
Lets suppose you have a url of example.com/category-of-shoes
which leads to a post regarding such matter. When I type a non-existing post/page for example example.com/category
instead of getting a 404 response I get bounced to example.com/category-of-shoes
.
What could be the problem here? This is happening on some sites I maintain and I'm afraid that someone might be able to exploit this. Also is this related to cgi.fix_pathinfo?
My Conf file for the server:
upstream php {
server 127.0.0.1:9000;
}
server {
listen 80;
set $host_path "/var/www/vhosts/example.com/";
access_log /var/log/nginx/example.com-access.log;
error_log /var/log/nginx/example.com-error.log error;
server_name example.com;
root $host_path;
charset utf-8;
index index.php;
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
index index.php;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
error_page 404 /404.html;
error_page 500 502 503 504 /static.html;
}
Also I'm a bit confused about all the options people seem to give for the WP Permalink "rewrite" on nginx. most of what i see revolves around: try_files $uri $uri/ /index.php$is_args$args;
inside the location /
block. Can someone explain me this issue pleas?
0 Answers