Nginx下proxy_set_header 模块代码

下文给各位重点介绍Nginx下proxy_set_header 模块代码,要了解的朋友不防进入看看吧.前言:由于新注册的腾讯企业邮箱已经无法绑定域名(之前绑定的依然可以使用),因此采用nginx模块来强制转向.代码:

  1. server {
  2. listen 80;
  3. server_name mail.t4x.org;
  4. rewrite ^/(.*)$ https://mail.t4x.org/$1 permanent;
  5. location / {
  6. root /site/t4x.org/mail;
  7. index index.html index.htm;
  8. }
  9. error_page 500 502 503 504 /50x.html;
  10. location = /50x.html {
  11. root /site/t4x.org/mail;
  12. }
  13. }
  14. server {
  15. listen 443 ssl spdy;
  16. server_name mail.t4x.org;
  17. ssl on;
  18. ssl_certificate mail.t4x.org_bundle.crt;
  19. ssl_certificate_key mail.t4x.org.key;
  20. ssl_session_cache shared:SSL:1m;
  21. ssl_protocols SSLv2 SSLv3 TLSv1;
  22. ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; --phpfensi.com
  23. ssl_prefer_server_ciphers on;
  24. location /
  25. {
  26. proxy_set_header Accept-Encoding xxxx;
  27. proxy_set_header Host mail.t4x.org;
  28. proxy_pass https://exmail.qq.com;
  29. sub_filter http://mail.t4x https://www.phpfensi.com;
  30. sub_filter_once off;
  31. }
  32. }

备注:需要--with-http_sub_module模块支持.