1、Nginx用户认证配置,添加多一层访问认证
http://www.ttlsa.com/nginx/nginx-basic-http-authentication/
2、useragent限制(防刷),
http://blog.csdn.net/qq_22929803/article/details/50724662
3、请求数限制
http://www.jb51.net/article/120185.htm
4、Nginx黑白名单IP配置
5、配置域名访问(直接域名访问)
http://www.jb51.net/article/93756.htm
直接域名访问即
由www.yhtzabbix.com/zabbix 改为 www.yhtzabbix.com直接访问
本地host配置
公网Ip 域名
4.4.4.4 www.yhtzabbix.com
红色为域名配置
蓝色为直接域名访问
紫色为黑白名单配置
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.yhtzabbix.com;
if ($host != ‘www.yhtzabbix.com‘) {
rewrite ^/(.*)$ http://yht1990.blog.51cto.com/$1 permanent;
}
location / {
#root html;
root /usr/local/nginx/html/zabbix/;
index index.php index.html index.htm;
}
location ~ \.php$ {
#root html;
root /usr/local/nginx/html/zabbix/;
allow 119.130.231.201;
deny all;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#auth_basic "nginx basic http test for ttlsa.com";
#auth_basic_user_file conf/htpasswd;
#autoindex on;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
本文出自 “YHT的运维笔记” 博客,请务必保留此出处http://yht1990.blog.51cto.com/9014030/1979268
原文地址:http://yht1990.blog.51cto.com/9014030/1979268