上流my_nodejs_upstream { サーバー127.0。0.1:3001 。 キープアライブ64 ; } サーバー{ 聞く80 。 SERVER_NAMEのwww.my - website.com。 #ssl_certificate_keyの/ etc / SSL / main.key。 #ssl_certificate の/ etc / SSL / main.crt。 位置 / { proxy_set_header X -Forwarded- $ proxy_add_x_forwarded_forについて、 proxy_set_header X -Real- IP $ REMOTE_ADDR。 proxy_set_headerホスト$ HTTP_HOST。 proxy_http_version 1.1 ; proxy_set_header $ http_upgradeをアップグレード。 proxy_set_header接続「アップグレード」。 proxy_passます。http:// my_nodejs_upstream /。 オフproxy_redirect; proxy_read_timeout 240S; } }
抜粋:http://pm2.keymetrics.io/docs/tutorials/pm2-nginx-production-setup