gennolo
Basic Pleskian
I recently switched some customer domains from php-cgi (apache served) to php-fpm (nginx served with apache as reverse proxy using the plesk-php56 package).
Everything went flawlessly and I had a great boost of performance - but I have an issue with url rewriting that is driving me crazy.
I have some websites running the prestashop cms.
If the cms is configured to have multiple languages the starting URL would be something like :
http://www.website.com/en/
http://www.website.com/fr/
http://www.website.com/it/
In this condition Nginx returns a 404 not found error when opening the page.
Of course with an apache-only configuration the url opens correctly and returns the homepage.
I can confirm that even with php-fpm, the native apache prestashop rewrite rules in ".htaccess" are working properly once the web request arrive to apache (because of the reverse proxy configuration)... but this particular request seems to be processed by nginx directly ...
The problems seems to be the trailing slash, in fact if I type the URL with "/en" - the site opens correctly.
It looks like nginx search for index file, not being able to find it.
Those are the solution I tried without success :
1 - Using the .htaccess to nginx converter (same problem)
2 - Using a nginx rewrite rule ( rewrite ^/(.*)/$ /$1 permanent; ) in nginx.conf file to force redirecting slash requests to non-slash requests but this lead me to other redirection-loop url troubles.
any idea for a proper configuration ?
Everything went flawlessly and I had a great boost of performance - but I have an issue with url rewriting that is driving me crazy.
I have some websites running the prestashop cms.
If the cms is configured to have multiple languages the starting URL would be something like :
http://www.website.com/en/
http://www.website.com/fr/
http://www.website.com/it/
In this condition Nginx returns a 404 not found error when opening the page.
Of course with an apache-only configuration the url opens correctly and returns the homepage.
I can confirm that even with php-fpm, the native apache prestashop rewrite rules in ".htaccess" are working properly once the web request arrive to apache (because of the reverse proxy configuration)... but this particular request seems to be processed by nginx directly ...
The problems seems to be the trailing slash, in fact if I type the URL with "/en" - the site opens correctly.
It looks like nginx search for index file, not being able to find it.
Those are the solution I tried without success :
1 - Using the .htaccess to nginx converter (same problem)
2 - Using a nginx rewrite rule ( rewrite ^/(.*)/$ /$1 permanent; ) in nginx.conf file to force redirecting slash requests to non-slash requests but this lead me to other redirection-loop url troubles.
any idea for a proper configuration ?