複数のアプリケーション用の単一のnginx設定

複数のアプリケーション用の単一のnginx設定

Linux EC2インスタンスでWebアプリケーションをホストしています。このWebアプリケーションは、app1&という名前の2つの小さなPythonアプリケーションで構成されていますapp2

私が望むもの:

リクエスト/sales- >でウェブページを表示しますapp1

リクエスト/operation- >でウェブページを表示しますapp2

私のnginx設定。

server {
    listen       80;
    listen       [::]:80;
    server_name  _;
    include /etc/nginx/default.d/*.conf;

    error_page 404 /404.html;
    location = /404.html {
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }

    location /sales {
        include uwsgi_params;
        uwsgi_pass unix:/run/uwsgi/sales.sock;
    }

    location /operation {
        include uwsgi_params;
        uwsgi_pass unix:/run/uwsgi/operation.sock;
    }

}

ブラウザからアクセスしようとすると、最初の結果は期待どおりに表示されますが、Webサイトではなく/sales別の結果が/operation返されます。Error 404app2

私は何が間違っていましたか?

助けてくれてありがとう。

ベストアンサー1

おすすめ記事