使用 nginx 做http代理

在Ubuntu上,下面的配置是有效的:

server {
      listen 80;
      server_name news.example.com;
      location / {
          proxy_pass http://192.168.1.123;
          proxy_set_header Host $host;
      }
 }

如果使用 $sheme://$host 代替 http://ip 则报 502 错误。

posted on 2012-09-01 17:49  还是刀哥靠谱  阅读(755)  评论(0编辑  收藏  举报

导航