IP restrictions for directories in nginx

  
                  

nginx phpmyadmin is open for intranet ip users and external network ip users are closed (in the previous configuration, location ~ ^/directory /use regular, priority is higher than location /configuration, so nginx can not parse the home page)
Code is as follows

server {

listen 80;

server_name example.com;

access_log logs/access.log main;

Location /{

root html;

index index.php index.html index.htm;

}

location ~ ^/phpmyadmin/{< Br>

allow 192.168.1.0/24;

deny all;

location ~ .*.(php

Copyright © Windows knowledge All Rights Reserved