这是indexloc提供的服务,不要输入任何密码
Skip to content

Wrong app URL when no VHOST file exists #879

@1player

Description

@1player

Problem:

If you delete the VHOST file because you want to use port-based deployment (i.e. you're installing dokku in a VM), I expect the application to be deployed at http://hostname:port as per documentation.
But the current release deploys the app on http://app-name.hostname, ignoring the fact that no VHOST is set.

Steps to reproduce:

  1. Install dokku
  2. Remove /home/dokku/VHOST
  3. Deploy sample node-js-app
  4. In the git push output you'll see
=====> Application deployed:
http://node-js-app.<hostname>

Expected outcome:

=====> Application deployed:
http://<hostname>:<port>

Possible fix:

dokku url node-js-app returns the wrong hostname although the logic is correct.
The issue is in dokku nginx:build-config node-js-app as the logic to deploy on a port is executed only when the NO_VHOST variable is set (https://github.com/progrium/dokku/blob/master/plugins/nginx-vhosts/commands#L32)

Setting it manually works as expected:

root@combotest:~# env NO_VHOST=1 dokku nginx:build-config node-js-app
-----> NO_VHOST set, deleting node-js-app/VHOST
-----> NO_VHOST set, deleting nginx.conf
-----> NO_VHOST set, reloading nginx after nginx.conf deletion

I suspect this NO_VHOST variable should be set after deploy before calling nginx:build-config, but it isn't.

If you can point out which is the best place to set this variable, I can do a pull request myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions