I use nginx (php-fpm) and fatfree framework. I need some redirect logic in my routing engine. It looks like:
http://example.net/page/...
Instead of dots there could be something like:
another.net/someurl
http://another.net/?local_query
another.net/path/to/article.html
It breaks nginx logic and I see 404 error.
My nginx config looks simply:
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include /etc/nginx/conf.d/fastcgi_params.conf;
fastcgi_param SCRIPT_FILENAME /var/www/$main_host/www$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/$main_host/www;
fastcgi_param PHP_ADMIN_VALUE upload_tmp_dir=/var/www/$main_host/tmp/upload;
fastcgi_param PHP_ADMIN_VALUE session.save_path=/var/www/$main_host/tmp/sessions;
}
So when I use:
http://example.net/page/another.net/path/to/article.html
Nginx tries to find file in filesystem with name article.html as I understand. How to write rule to ignore any symbols when there is keyword page after domain?
locationblock, likelocation ~ /page/