如何在不使用 VHOST 的情况下在端口 80 使用 Dokku 的应用程序 运行?

How can I have an app running using Dokku at port 80 without using VHOST?

我正在尝试 运行 一个使用 Dokku 的应用程序,不使用 VHOST,只使用一个 IP 地址,到 运行 端口 80

如果我没记错的话,如果你想使用 Dokku 开发一个应用程序,你需要使用 vhost 方法 - 将它安装在 your.domain.tld:80 - 或者你需要点击直接端口。

我解决了在我的 dokku 应用程序中放置 nginx.conf 的问题

upstream flask-domains { server 127.0.0.1:PORT; }
  server {
    listen        [::]:80;
    listen        80;
    server_name   external_ip;

    location / {
      proxy_pass http://flask-domains;
      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;
    }
}

您应该将 PORT 更改为您的 dokku 应用程序中 PORT 文件中的 PORT,并将 external_ip 更改为您正在使用的 IP