- 积分
- 23
- 威望
-
- 金钱
-
- 注册时间
- 2016-4-17
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
我服务器装了lnmpa1.2的版本.现在有个需求.假设我现在部署了一个网站,用的域名是123.bb.com.然后要把对123.bb.com/path的请求转发到123.cc.com:7700上,那我在nginx里该怎么配置?目前在nginx配置文件的server段里加了下面的代码,但是没有效果.
请问要实现上面的需求,该怎么配置nginx文件?
location /lctong {
root html;
index index.html index.htm;
proxy_pass http://123.cc.com:7700;
#proxy_pass http://localhost:8080;
#proxy_pass http://192.168.100.125:8080;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
} |
|