码迷,mamicode.com
首页 > 其他好文 > 详细

nginx根据项目名实现内网地址转发

时间:2019-01-22 14:13:25      阅读:570      评论:0      收藏:0      [点我收藏+]

标签:dir   logs   .net   地址   根据   details   access   The   direct   

nginx根据访问的项目名进行内网地址转发

以下是nginx的配置信息:

server {
listen 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;

location / {
root html;
index index.html index.htm;
}
#匹配以访问的项目名跳转到对应的内网地址
location /huwj {
proxy_pass http://127.0.0.1:8002/huwj;
}
#跳转到test项目
location /test {
proxy_pass http://127.0.0.1:8083/;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
---------------------
作者:hu_wen
来源:CSDN
原文:https://blog.csdn.net/hu_wen/article/details/79959430
版权声明:本文为博主原创文章,转载请附上博文链接!

nginx根据项目名实现内网地址转发

标签:dir   logs   .net   地址   根据   details   access   The   direct   

原文地址:https://www.cnblogs.com/zhoading/p/10303261.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!