• 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

Question HostnameLookups

moswak

Regular Pleskian
Hi,

centos 7/ Plesk 12.5 apache/nginx

i want to allow access only for some providers and my htaccess on an only apacheserver works fine like

Order deny,allow
Deny from all
Allow from .t-ipconnect.de

but on the pleskserver this doesnt work.

I set in the Additional Apache directives for the domain:
HostnameLookups On

but this doesnt help. where is my error ?


 
You have both apache/nginx running.
So initially all requests go to nginx and if its static content, it just delivers it.

You have two choices. Either disable nginx and your .htaccess file will just work (since you would only be using apache).

Or if you want any of the benefits of also using nginx (I won't get into that flame war), then you can write your rules to work with nginx, or find another way to do what you want with nginx.
Look at their explanation about .htaccess: https://www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/#

If you want to rewrite your .htaccess rules for nginix, see http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
it covers much of it, but not 100% accurate.
 
When i disable nginx (disable Smart static files processing "If turned off, Apache will process all requests for static files. nginx will only pass requests and responses without modification. Turn off this option only for troubleshooting") the .htaccess doesnt work :-(

or is there another way to disable nginx just for one domain ?
 
Back
Top