• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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