• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Limit access to URL by IP address using nginx

Paul Larson

Basic Pleskian
I'm at my wits end on this one.

I have a URL example.com/order-export

I want access to that URL to be limited by IP address.

When I make a physical Linux directory, order-export, the Nginx config below works:

location = /order-export {
allow 1.2.3.4;
deny all;
}

Now, after I remove order-export, that same URL is handled by my CMS (ExpressionEngine). example.com/order-export remains browsable.

What might I be missing, such that the Nginx rule will work for dynamic URLs rather than physical directories?
 
Update: I do use the Reverse Proxy Server (nginx) setting on this Plesk server.

Might my rules need to be adjusted to know about the local proxy IP and port? (I'm not sure what those would be)
 
Nginx only processes static files unless you turn the proxy option off. So probably the directive is ineffective, because the CMS uses .php files?
 
Peter,

How exactly do I turn of the Nginx proxy, but maintain Nginx as the web server for that domain? Seems if I disable the Reverse Proxy (nginx) Service in Plesk, I no longer get an 'Nginx' option when I select the PHP version for a domain.
 
No, sorry, you are asking something different. You do NOT want to disable Nginx. You want to run all through Nginx, right? When you want to serve PHP through Nginx you want Nginx-only hosting. In that case simply uncheck the Proxy box in the Apache & Nginx settings dialog.
 
Back
Top