mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-23 05:53:42 +00:00
添加nginx防止爬虫爬取配置 (#1187)
* 添加nginx防止爬虫爬取配置 * Update nginx.conf * Update README.md
This commit is contained in:
@@ -3,6 +3,13 @@ server {
|
||||
server_name localhost;
|
||||
charset utf-8;
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
# 防止爬虫抓取
|
||||
if ($http_user_agent ~* "360Spider|JikeSpider|Spider|spider|bot|Bot|2345Explorer|curl|wget|webZIP|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|NSPlayer|bingbot")
|
||||
{
|
||||
return 403;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri /index.html;
|
||||
|
Reference in New Issue
Block a user