
ポート 3000 で npm 経由でサービスを実行しました。
私の nginx 設定は次のようになります:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html/public/;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
return 301 http://fake.url:3000$request_uri;
}
動作しており、ブラウザでサイトを開くことができます。しかし、URL に :3000 が表示されます。URL からこれを削除するにはどうすればよいですか?
答え1
server {
listen 80 default_server;
listen [::]:80 default_server;
location {
proxy_pass http://fake.url:3000;
}
}