Nginxサービス許可制御とランダムホームページ

Nginxサービス権限制御

nginxでは、デフォルトで誰でもアクセスできます

設定へのアクセスを許可する

allow 192.168.2.3;
allow all;

設定へのアクセスを拒否する

deny 192.168.2.3;
deny all;

例:nginxは、すべてのユーザーにIPへのアクセスを許可し、10.98.226.96アクセスを拒否します

location / {
            root   html;
            index index.php index.html index.htm;
                
            deny 10.98.226.96;
            allow all;
        }

NginxRandom_indexランダムホームページ

Random_indexモジュールを開きます。

--with-http_random_index_moduleを使用すると、Random_indexモジュールがすでにサポートされていることを意味します。

/usr/local/nginx/sbin/nginx -V 

random_indexは以下を使用します:

random_index on;

使用する:

location / {
            root   html;
           random_index on;
           # index index.php index.html index.htm;
            
        }


#クライアントテストhttp://106.52.36.65

おすすめ

転載: blog.csdn.net/weixin_39218464/article/details/112710816