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; } } }