使用Nginx做反向代理的配置

时间:2020-09-17 00:58:51   收藏:0   阅读:52

安装Nginx服务之后 修改Nginx配置文件

如下server字段中主要是配置listen监听8080 端口,然后静态文件袋里到8001  后端端口代理到8000 

server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        #location / {
        #   root   html;
        #    index  index.html index.htm;
        #    
        #}

        location / {
            proxy_pass http://localhost:8001;
        }
        location /api/ {
            proxy_pass http://localhost:8000;
            proxy_set_header Host $host;
        }

 

原文:https://www.cnblogs.com/qqfontofweb/p/13682207.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!