• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 11.5 + nginx = no .htaccess ?

David Aguilar

Basic Pleskian
Hi,

I have plesk 11.5 , configured nginx to serve php files.

If I enable this option, a magento site can't process some rewrite rules. I suspect that this is because nginx can't read .htaccess files ?

If I turn off php process by php all is working right ( even with nginx's intelligent process + static files served by nginx )
 
Yes, nginx+php-fpm does not process .htaccess files. So you need to setup custom nginx directives for your apps.
 
Yup. nginx does not support .htaccess files for performance reasons.

Therefore some applications may not function properly in php-fpm mode. You may use a custom per-vhost nginx configuration (vhost_nginx.conf) as a workaround.
 
Doesn't plesk like generate this new vhosts file every day? I didn't still try this with plesk but on other system without plesk where i run nginx i know when i setup once rewrites and everything in vhost I don't touch this. Not sure how this work with plesk, but yeah...if file get reseted to default outcome is obvious, no rewrites = application/website is not working. Any KB regarding this, I'm curious how Plesk handle this :)
 
Nothing is regenerated "every day" without a reason to.

/var/www/vhosts/domain.tld/conf/vhost_nginx.conf is a custom file that you may create and then call
# plesk sbin httpdmng --reconfigure-all
and it will be included in Plesk 11.5 configuration for nginx. It will not be overwritten by Plesk (just like vhost.conf and vhost_ssl.conf for Apache).
 
Awesome, I knew they probably take care of that (i'm on 11.0.9 so I didn't knew). This one is very nice.

Thanks Nikolay.
 
Hi,

I think there's somehow a workaround, as nginx can "redirect" some files to apache, so you can combine apache to read .htaccess ( so make redirs of magento ) and nginx passing simply php code.

My problem now is that I turn on PHP-FPM but it's still processing as PHP-FastCGI
 
Yes, nginx+php-fpm does not process .htaccess files. So you need to setup custom nginx directives for your apps.


this is not true, I have a website where htaccess works and plesk is configured to use php-fpm, 3 items are all checked in the web server configuration settings.

Why continue to run apache2 and htaccess?
 
Back
Top