前言:由于新注册的腾讯企业邮箱已经无法绑定域名(之前绑定的依然可以使用),因此采用nginx模块来强制转向!
代码:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
server { listen 80; server_name mail.t4x.org; rewrite ^/(.*)$ https://mail.t4x.org/$1 permanent; location / { root /site/t4x.org/mail; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /site/t4x.org/mail; } } server { listen 443 ssl spdy; server_name mail.t4x.org; ssl on; ssl_certificate mail.t4x.org_bundle.crt; ssl_certificate_key mail.t4x.org.key; ssl_session_cache shared:SSL:1m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location / { proxy_set_header Accept-Encoding gzip; proxy_set_header Host mail.t4x.org; proxy_pass https://exmail.qq.com; sub_filter http://mail.t4x https://mail.t4x; sub_filter_once off; } } |
备注:需要--with-http_sub_module模块支持!SourceByrd's Weblog-https://note.t4x.org/environment/nginx-proxy-set_header/ SourceByrd's Weblog-https://note.t4x.org/environment/nginx-proxy-set_header/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!