Nginx下proxy_set_header 模块代码

前言:由于新注册的腾讯企业邮箱已经无法绑定域名(之前绑定的依然可以使用),因此采用nginx模块来强制转向!

代码:

    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 xxxx;
proxy_set_header Host mail.t4x.org;
proxy_pass https://exmail.qq.com;
sub_filter http://mail.t4x https://www.111cn.net;
sub_filter_once off;
}
}

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

时间: 2024-07-30 19:01:41

Nginx下proxy_set_header 模块代码的相关文章

nginx下sysgurad模块防止高负载的解决方案

如果nginx被攻击或者访问量突然变大,nginx会因为负载变高或者内存不够用导致服务器宕机,最终导致站点无法访问.今天要谈到的解决方法来自淘宝开发的模块nginx-http-sysguard,主要用于当负载和内存达到一定的阀值之时,会执行相应的动作,比如直接返回503,504或者其他的.一直等到内存或者负载回到阀值的范围内,站点恢复可用.简单的说,这几个模块是让nginx有个缓冲时间,缓缓. 1. 安装nginx sysguard模块 1.1 下载文件  代码如下 复制代码   # wget

nginx下nginx_upload_module模块传递GET参数

下面我解决nginx_upload_module使用GET传参的方法公布出来,希望能够帮助到和我一样需求的朋友! 修改nginx配置文件(程序站点配置文件test.conf)  代码如下 复制代码 location /upload_waynerqiu { upload_pass_args on; upload_resumable on; upload_pass /up_test.php?$args; #此处省略掉详细配置- } html表单代码(up_test.php,此页面即作为表单页同时也负

Nginx下HttpImageFilterModule模块安装实现缩略图服务器

HttpImageFilterModule用来处理转换图片(JPEG.GIF和PNG),是nginx自带的模块,默认不会开启,需要在编译安装的时候加上参数–with-http_image_filter_module 安装还是很简单的,默认HttpImageFilterModule模块是不会编译进nginx的,所以要在configure时候指定 ./configure arguments: --prefix=/usr/local/nginx --with-http_image_filter_mod

Nginx下proxy

 下文给各位重点介绍Nginx下proxy_set_header 模块代码,脚面要了解的朋友不防进入看看吧.     前言:由于新注册的腾讯企业邮箱已经无法绑定域名(之前绑定的依然可以使用),因此采用nginx模块来强制转向! 代码:     server { listen       80; server_name  mail.t4x.org; rewrite ^/(.*)$ https://mail.t4x.org/$1 permanent; location / {     root  

Symfony2在Nginx下的配置方法图文教程_php实例

本文详细讲述了Symfony2在Nginx下的配置方法.分享给大家供大家参考,具体如下: 网上有很多关于symfony2在nginx下的配置文章,如果是小白,按照网上贴出来的配置文件配置,却怎么也不成功,我经过多次摸索,写下心得: 1. 首先开启Nginx的pathinfo 至于什么是pathinfo,可以参考文章<nginx下支持PATH_INFO的方法实例详解>,自行脑补.很多人按照教程配置的时候,会报500的错误,查报错日志也查不出来,八成就是没有开启pathinfo. 如果你的主机上安

nginx上传模块—nginx upload module

nginx上传模块 一. nginx upload module原理 官方文档: http://www.grid.net.ru/nginx/upload.en.html Nginx upload module通过nginx服务来接受用户上传的文件,自动解析请求体中存储的所有文件上传到upload_store指定的目录下.这些文件信息从原始请求体中分离并根据nginx.conf中的配置重新组装好上传参数,交由upload_pass指定的段处理,从而允许处理任意上传文件.每个上传文件中的file字段

01_Nginx安装,nginx下部署项目,nginx.conf配置文件修改,相关文件配置

 1.下载Nginx,进入Nginx下载地址:http://nginx.org/ 点击nginx-1.8.0,进入:http://nginx.org/en/download.html,下载文件: 2 下载pcre,这个是一个正则表达式的库,Nginx做rewriter的时候回用到这个库: 进入pcre的官网(rewrite模式需要pcre):http://www.pcre.org/ 选中右击复制所需要的版本: 3 下载zlib库(gzip模块需要zlib):http://www.zlib.n

nginx上传模块nginx_upload_module和nginx_uploadprogress_module模块进度显示,如何传递GET参数等。

ownload:http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gzconfigure and make : ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module   --add-module=/data/software/lnmp1.

Nginx和nginx-http-access模块防盗链配置与使用

此篇文章是关于nginx-http-access模块的延伸内容,就如何安装与配置nginx-accesskey防盗链进行了详细的说明,nginx.conf的配置文件也可做为参考,nginx下载认证的配置与使用供大家研究学习与借鉴. 注意:此文整理于互联网,未经过实际的安装测试,所以难免会有错误,如你在阅读本文并在测试的过程中遇到问题,欢迎至风信网官方以下地址进行反馈(http://www.ithov.com/member/article_add.php),我们将与您一起寻找正确的答案. 安装Ng