1. 程式人生 > >nginx根據項目名實現內網地址轉發

nginx根據項目名實現內網地址轉發

內網 htm 聲明 https log ESS localhost gin tails

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根據項目名實現內網地址轉發