我只能将PM2用于生产

时间:2019-10-22 08:42:03

标签: nginx pm2

两个问题:

  1. 是否需要在生产环境中将NGINX作为反向代理服务器与PM2一起运行?还是可以仅使用pm2?

  2. 如果我将nginx用作反向代理服务器,则在oauth期间会收到无效签名的错误消息。

以下是我的nginx conf

server {

    listen 443 ssl; # managed by Certbot
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
   }


}
server {
  listen 80;
  server_name example.com;
    #return 404; # managed by Certbot
  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
   }


}

0 个答案:

没有答案