I am using Nginx to proxy pass to my wsgi app served with Circus.
I want to allow the traffic to that app for some urls of the app only for some IP address.
For now it look like this:
server {
listen 80;
server_name service.dev;
access_log /var/log/service.access.log;
error_log /var/log/service.error.log debug;
location / {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:9000/;
}
location /admin/ {
allow 192.168.5.0/24;
deny all;
}
}
But it doesn't work. If I have the right, I get a 404 error instead of the proxy_pass.
Do you know how I can do that without having to copy/paste the proxy_pass configuration each time?
Thank you.