美文网首页
nginx反向代理

nginx反向代理

作者: 懒人程序猿 | 来源:发表于2020-06-28 17:44 被阅读0次

代理设置

server {
    listen 80;
    server_name www.host.com host.com;
    
    location / {
        proxy_pass http://127.0.0.1:8080;
    }
    
    location ~ /edu/ {
        proxy_pass http://127.0.0.1:8081;
    }
    
    location ~ /vod/ {
        proxy_pass http://127.0.0.1:8082;
    }
}

把访问 http://127.0.0.1的请求转发到 http://127.0.0.1:8080

把访问 http://127.0.0.1/edu 的请求转发到 http://127.0.0.1:8081

把访问 http://127.0.0.1/vod 的请求转发到 http://127.0.0.1:8082

相关文章

网友评论

      本文标题:nginx反向代理

      本文链接:https://www.haomeiwen.com/subject/eeiwfktx.html