Nginx配置访问白名单

server {
        listen       80;
        server_name  192.168.1.1;
        index index.html index.htm index.php;
        root /data/www/app/webroot;
        charset utf-8;
        allow 192.168.1.2;
        allow 192.168.1.3;
        deny all;

        location ~ .*\.php$ {
                include fcgi.conf;
                fastcgi_pass  127.0.0.1:10080;
                fastcgi_index index.php;
                expires off;
                access_log on;
                access_log  /data/logs/dpcq_php.log
                access buffer=32k;
        }
}

 

    注:allow XXX 允许访问的ip;deny XXX 拒绝访问的ip。

你可能感兴趣的:(随手摘记,Nginx)