Answer the question
In order to leave comments, you need to log in
How to give access to the site only from the internal network?
The enterprise has a server on which there is a site with a purchased ip and a domain name. Everything works, no issues.
How to attach another location block or another server block to the same nginx and attach another site to it so that it can only be accessed from the internal network of the enterprise (by ip address, probably)?
I will formulate it differently:
1. There is Site1 with a white ip and with a domain name - it needs to be shown to everyone on the Internet
2. There is Site2 without a white ip and without a domain name - it needs to be shown only on the internal network
How to register this in nginx.conf blocks ?
Answer the question
In order to leave comments, you need to log in
server {
listen 192.168.0.1:80;
listen 192.168.0.1:443 ssl;
server_name example.ru;
...
}
server {
listen 80;
listen 443 ssl;
server_name example.ru;
satisfy any;
allow 192.168.0.1/24;
allow 192.168.1.1/24;
allow 192.168.2.100;
deny all;
...
}
Just write in Google your request in English https://docs.nginx.com/nginx/admin-guide/security-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question