nginx配置多域名反向代理

upstream myproxy {

server 192.168.100.2;

}

server {

listen 80;

server_name test.82438.com test.fouyue.com;

#charset utf-8;

#access_log logs/host.access.log main;

location / {

root html;

index index.html index.htm;

proxy_pass http://myproxy;

proxy_set_header host $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

index index.html index.htm index.php;

}

这里 index index.html index.htm index.php;

也可以写成 proxy_redirect default;

posted @ 2011-08-23 09:28  amityat  阅读(278)  评论(0编辑  收藏  举报