接上一篇博文
http://chenshoubiao.blog.51cto.com/6159058/1885240
vim /usr/local/nginx/conf/vhosts/proxy.conf
server {
listen 80;
server_name www.111.com;
location /
{
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
/usr/local/nginx/sbin/nginx -t 检查
/usr/local/nginx/sbin/nginx 启动如果没有起到脚本可以/usr/local/nginx/sbin/nginx -s reload
测试:curl -x127.0.0.1:80 www.111.com/111.jsp
本文出自 “比尔linux运维笔记” 博客,请务必保留此出处http://chenshoubiao.blog.51cto.com/6159058/1885241
原文地址:http://chenshoubiao.blog.51cto.com/6159058/1885241