Windows上的多台服务器的Nginx配置问题

时间:2019-04-07 09:58:19

标签: nginx nginx-reverse-proxy nginx-config

我正在 Windows 10 上使用 NGINX 进行反向代理,以运行在同一台计算机上运行的多个Web应用程序,但使用Python编写的不同端口。我正在使用以下配置,但是在尝试访问localhost / west或localhost / test时出现404错误代码。

events {
    worker_connections  1024;
}


http {

    server {
            listen 80 default;
            listen [::]:80 default_server;

            location /{
                    proxy_pass          http://127.0.0.1:8080;
                    proxy_read_timeout  90;
                }

            location /test{
                    proxy_pass          http://127.0.0.1:8081;
                    proxy_read_timeout  90;

                }

            location /west{
                    proxy_pass          http://127.0.0.1:8082;
                    proxy_read_timeout  90;
                }

    }
}

我确实尝试在配置文件中重写^ / test(。*)$ 1 break; ,但这也不起作用。解决该问题的任何建议将不胜感激。谢谢。

0 个答案:

没有答案
相关问题