Nginx配置文件中的位置块无法正常工作?

时间:2019-05-02 10:27:46

标签: nginx nginx-location jwilder-nginx-proxy

我在/ etc / nginx / sites-available / default中有nginx配置文件。我正在使用location指令为两个网站提供服务。但是我的第一个网站可以在“ http://my-ip”上正常运行,但是当我点击第二个网站“ http://my-ip/user”时,它将呈现我的第一个网站。我的默认配置文件看起来像这样

server {
        listen 80 default_server;
        listen [::]:80 default_server;
        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;
        error_log  /var/log/nginx/nginx_error.log  warn;

        location / {
                proxy_pass http://127.0.0.1:5000;
        }
        location /user {
                 proxy_pass "http://127.0.0.1:6000";
        }
}

我的两个网站都在5000和6000端口上运行。请帮我解决这个问题。

0 个答案:

没有答案
相关问题