展开目录
nginx用域名来转发请求
nginxupstream
X
陈尼玛的博客
记录开发生涯的踩坑经历,用时间来验证成长
加载中

修改nginx.conf

upstream test-svr {
  server 127.0.0.1:81;
}

server {
  listen  80;
  server_name test-localhost.com;
  location / {
    proxy_pass http://jnpm-svr;
    proxy_http_version 1.1;
    proxy_set_header Connection $http_connection;
  }
}

添加 /etc/hosts

127.0.0.1 test-localhost.com

此时curl test-localhost.com就会转发到81端口了

相关文档

暂无

随便看看

  1. css3自定义滚动条样式

  2. nodejs 长连接

  3. raw.githubusercontent.com DNS被指向127.0.0.1

  4. curl用法

  5. npm包命令行调用

  6. nodejs本地双向代理 端口转发

  7. nodejs socks5

  8. 树莓派实现用pi用户自动登录

  9. html5 全屏代码

  10. heroku查看app使用时间

  11. 模拟307跳转情况

  12. cdn资源列表

  13. TIME_WAIT过多

  14. git配置服务端支持http认证

  15. mongodb2.4 添加用户

  16. 树莓派配置收发邮件

  17. youku电脑版跳过广告代码

  18. 感谢beego陪伴我度过那不靠谱的半年

畅言模块加载中