E
E
Evgeny Vorobyov2021-06-18 11:05:46
Nginx
Evgeny Vorobyov, 2021-06-18 11:05:46

How to block access to sites in NGINX?

The home server has Apache + NGINX (as a proxy).
Installed nextcloud, pgadmin4, smokeping. They are running through Apache.
Port 443 is forwarded on the router.
If you enter, then everything opens normally on the links:
https:///smokeping/
https:///pgadmin4/
https:///nextcloud/ ..But
I need to block the first two links "from outside".

Add item to nginx config


location /smokeping {
allow 192.168.11.0/25;
deny all;
}

Access "from outside" disappears with error 403... and from LAN too, but with error 404.
Who can help/direct/suggest? What logs/configs are needed?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-06-18
@astrave

location / {
    proxy_pass http://backend;
}

location ~ ^/(smokeping|pgadmin4) {
    allow 192.168.11.0/25;
    deny all;
    
    proxy_pass http://backend;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question