- upstream github {
- server github.com:443;
- }
-
- server
- {
- server_name xxx.com;
- listen 443 ssl http2 reuseport;
-
- ssl_certificate /root/ssl/xxx/cert.pem;
- ssl_certificate_key /root/ssl/xxx/key.pem;
-
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_session_timeout 1d;
- ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
- ssl_prefer_server_ciphers on;
- ssl_session_cache shared:SSL:50m;
- ssl_session_tickets on;
- ssl_stapling on;
-
- if ($http_user_agent ~* "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") #防止搜索引擎收录
- {
- return 403;
- }
-
- location / {
- proxy_set_header Accept-Encoding "";
- proxy_set_header Connection "";
- proxy_http_version 1.1;
- proxy_connect_timeout 10s;
- proxy_read_timeout 10s;
- proxy_set_header Host github.com;
-
- proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
-
- proxy_pass https://github;
- }
- }
复制代码
|