标签:
nginx二级域名配置自动跳转到一级域名 rewrite配置内容: if ($http_host !~ "^www.aaa.com$") { rewrite ^(.*) http://www.aaa.com$1 permanent; } 下方,nginx代理访问项目proxy_pass,及rewrite参考 server { listen 80; server_name www.aaa.com 100.100.100.100; location / { if ($http_host !~ "^www.aaa.com$") { rewrite ^(.*) http://www.aaa.com$1 permanent; } proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.1.2:8000; } access_log logs/aaa.com_access.log; }
标签:
原文地址:http://www.cnblogs.com/hui-blog/p/5583962.html