Welcome! Log In Create A New Profile

Advanced

Nginx Valid Referer - Access Control - Help Wanted

February 05, 2020 02:43PM
I want to use nginx referer module to restrict access to a URL containing a directory /radio/
Only allowing access to it from a link with http referer *.mysite.* (anysubdomain.mysite.anytld) otherwise redirect to 403

Is the referer module already loaded in nginx if not how do I load it

I found various code examples to add to the conf file and coupled this together and added it to the end of the conf file, but it doesn't work, entering a URL directly into the browser serves it

<code>
server {
location /radio/ {
valid_referers none blocked server_names ~\.mysite\.;
if ($invalid_referer) {
return 403;
}
}
}
</code>

Should just the location bit of code be added inside an existing server block

My set up is nginx in docker on Ubunto 18 on a Digital Ocean droplet

Any help would be appreciated, been working on this for days

Best regards
Ashley
Subject Author Posted

Nginx Valid Referer - Access Control - Help Wanted

AshleyinSpain February 05, 2020 02:43PM

Re: Nginx Valid Referer - Access Control - Help Wanted

J.R. February 05, 2020 04:42PM

Re: Nginx Valid Referer - Access Control - Help Wanted

AshleyinSpain February 06, 2020 06:02PM

Re: Nginx Valid Referer - Access Control - Help Wanted

Francis Daly February 06, 2020 07:10PM

Re: Nginx Valid Referer - Access Control - Help Wanted

AshleyinSpain February 19, 2020 06:30PM

Re: Nginx Valid Referer - Access Control - Help Wanted

Francis Daly February 20, 2020 09:22AM

Re: Nginx Valid Referer - Access Control - Help Wanted

gariac February 07, 2020 07:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready