Hello, If it is possible to add some on default.conf that i can deny all from my page and only allow some IP? Here is my default.conf but I dont know how I need to do... server { set $rootpath "/var/www/ipmp"; root $rootpath; listen 80; if ($request_uri ~ (/).*) { rewrite ^ https://$host$request_uri? permanent; } if ($request_uri ~ (/mobile/).+) { rewrite ^ https://$host$request_uri? permanent; } if ($request_uri ~ (/interactive/).*) { rewrite ^ https://$host$request_uri? permanent; } include /etc/nginx/part.d/*.part; } server { set $rootpath "/var/www/ipmp"; root $rootpath; listen 443 ssl; keepalive_timeout 70; server_name $host; ssl_certificate /ha_shared/ipmp/config/certificates/cert.csr; ssl_certificate_key /ha_shared/ipmp/config/certificates/cert.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_session_cache shared:SSL:20m; ssl_session_timeout 10m; include /etc/nginx/part.d/*.part; include /etc/nginx/part.d/onlyssl/*.part; } Code (markup): Where I need add that deny all? That is my root path: /var/www/ipmp . Hope some can help.
This can be improved by using the directive designed for that task. ErrorDocument 403 /specific_page.html Order Allow, Deny Allow from 111.222.333.444 Where 111.222.333.444 is your static IP address. While using the "Order Allow, Deny" directive, the request must match either Allow or Deny, if none is met, the request is denied.
Hi Sebastian, You can create a new Nginx location block with the following content: location / { allow 1.2.3.4; deny all; } Code (markup): Replace 1.2.3.4 with your actual IP address, and restart Nginx for the changes to take effect.