【问题标题】:Which IP address goes in proxy_pass when configuring NGINX配置 NGINX 时哪个 IP 地址进入 proxy_pass
【发布时间】:2020-02-17 02:42:19
【问题描述】:

NGINX 配置文件nginx.conf 中的位置 proxy_pass 中的哪个 IP 地址?是服务器的公网IP吗?

http {
  ...
  location /api/ {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://<which ip address goes in here?>: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;
  }
}

【问题讨论】:

    标签: node.js express nginx


    【解决方案1】:

    它不必是公开的,但你的 nginx 必须能够解决它。如果您的后端在同一台机器上运行,则它可以是私有网络 IP 地址或127.0.0.1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-31
      • 1970-01-01
      • 2013-10-20
      • 2012-10-02
      • 2017-08-25
      • 1970-01-01
      • 2021-06-01
      • 2019-12-22
      相关资源
      最近更新 更多