码迷,mamicode.com
首页 > 其他好文 > 详细

nginx反向代理substitutions4nginx模块实现替换字符盗站 nginx.conf配置

时间:2016-04-04 13:02:18      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

nginx反向代理substitutions4nginx模块实现替换字符盗站 nginx.conf配置

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server_tokens  off;
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_comp_level 2;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    gzip_vary off;
    gzip_disable "MSIE [1-6]\.";
    proxy_cache_path /home/zbs/jiajucache levels=1:2 keys_zone=jiaju:20m max_size=2g inactive=72h;
    server {
        listen       80;
        server_name  jiaju.ydjy365.com;
        location / {
            subs_filter ‘jiaju.sg169.com‘ ‘jiaju.ydjy365.com‘ gi;
            proxy_set_header Host jiaju.sg169.com;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Referer http://jiaju.sg169.com;
            proxy_set_header Accept-Encoding ‘‘;
            proxy_pass http://jiaju.sg169.com;        
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires 10d;        
            proxy_pass http://jiaju.sg169.com;
            proxy_cache jiaju;
            proxy_cache_valid 72h;
        }    
        location ~ .*\.(js|css)$
        {
            expires 12h;
            proxy_pass http://jiaju.sg169.com;
            proxy_cache jiaju;
            proxy_cache_valid 12h;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

 

nginx反向代理substitutions4nginx模块实现替换字符盗站 nginx.conf配置

标签:

原文地址:http://www.cnblogs.com/zhongheng/p/5351628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!