nginx反向代理apache

江流爱百花 2016-10-09 04:31:25
nginx端口80,LAMP中的apache2端口8080,
设置nginx转发apache2 ,配置文件如下
server {
listen 80;
server_name blog.example.me;

access_log /var/log/nginx/access.log;

location / {
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://127.0.0.1:8080;
}
}

域名是NameCheap的,绑定的服务器的公网IP,访问没有问题,但是输入域名后会跳转服务器IP:8080 ,有没有办法只显示域名,不显示IP和端口的。
...全文
145 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kkjjww 2016-10-09
  • 打赏
  • 举报
回复
我这样做是正确的啊

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧