Skip to content

Instantly share code, notes, and snippets.

@hn-support
Created January 8, 2021 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hn-support/3d0ec225e7fd49e6996377e48996f57c to your computer and use it in GitHub Desktop.
Save hn-support/3d0ec225e7fd49e6996377e48996f57c to your computer and use it in GitHub Desktop.
# You can whitelist request that should be exempt from the development
# basic auth.
# It's possible to whitelist request based on their IP address, range,
# User-Agent, or by the requested URL.
# Please note though, that google and bing bots will always remain
# blocked on development nodes!
# Both IP addresses and IP ranges can be whitelisted here.
geo $development_exceptions_ip {
default "Development restricted area";
127.0.0.1/32 "off";
}
# It's also possible to whitelist specific user agents
map $http_user_agent $development_exceptions_ua {
default $development_exceptions_ip;
~*(magereport|letsencrypt) "off";
}
# You can exclude specific URL's from the development
# basic auth.
# The whitelist is based on the entire request.
# If you wish to whitelist an entire path, you'll need
# to use a regular expression.
map $request_uri $development_exceptions {
default $development_exceptions_ua;
/robots.txt "off";
# ~^(/index\.php)/rest/V1 "off";
}
@klau85
Copy link

klau85 commented Feb 29, 2024

Hi,
can you give an example how i can whitelist a url like https://example.com/api/<> ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment