2
これは私のnginx conf
ファイルです。 example.com
とexample2.com
が働いているいくつかの理由 Nginx:同じサーバー上の複数の場所
server {
listen 80;
server_name example.com;
location/{
proxy_pass http://localhost:9000;
}
location /some/directory {
proxy_pass http://localhost:8998;
}
}
server {
listen 80;
server_name example2.com;
location/{
proxy_pass http://localhost:8999;
}
}
が、
example.com/some/directory
ではありません。
localhost:9000
&localhost:8999
は:harp.jsサイトです、彼らは(example.com & example2.com)の両方のローカルおよびプロキシ-EDドメイン上で、彼らはルーティングを所有していて、正常に動作します。localhost:8998
:golang apiです。ローカルで動作し、example.com:8998
またはexample2.com:8998
にアクセスしても動作します。
confには何か問題がありますか?
EDIT:さらに詳しい情報を追加しました。
「example.com:8998」の作業要求はどのように見えますか? – VBart
どのように見えるのですか?それは適切に動作します。 –
あなたの設定では、nginxは 'http:// localhost:8998/some/directory'を要求します。同じリクエストをテストしますか? – VBart