Loading

windows本地配置域名和nginx代理

摘自:https://www.cnblogs.com/chenxi-mxj/p/12157035.html

windows本地配置域名和nginx代理

 

1. 配置本机的DNS

C:\Windows\System32\drivers\etc\hosts 末行添加

127.0.0.1 jay.localhost.com

可以直接访问 http://jay.localhost.com:8080/相当于直接访问 http://localhost:8080/

 

2. 可以nginx去代理端口号

复制代码
upstream jay.localhost.com{

       server 127.0.0.1:8080;
    }

   server {

     listen 80;

     server_name jay.localhost.com;

     location / {

        proxy_pass http://jay.localhost.com;

        proxy_set_header X-forwarded-for $proxy_add_x_forwarded_for;

     }

}
复制代码
 
好文要顶 关注我 收藏该文  
0
0
 
 
 
« 上一篇: windows下安装elasticsearch和elasticsearch-head
» 下一篇: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
posted @ 2020-01-06 16:33  晨曦_mxj  阅读(386)  评论(0)  编辑  收藏

 

 
 
posted @ 2020-07-29 11:37  Sam Xiao  阅读(102)  评论(0编辑  收藏  举报