Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: How to allow access to a URL from only a selected IP

$
0
0
Nearly there I think. The below gives me the correct 403 response. If I however add

allow 192.168.1.51

I then get a 404 error.

I think it has something to do with the reserve proxy.

location ^~ /paperui/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;


deny all;

auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;

}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>