Dokku安装后更改设置 [英] Dokku change settings after install
问题描述
site.com
访问。我可以通过 site.com:port
访问我以前创建的Dokku容器,如何更改Dokku设置以访问我的应用程序 - appname.site .com
Per https://github.com/progrium/dokku :
设置域和通配符域指向给那个主机。确保
/ home / dokku / VHOST设置为此域。默认情况下,它设置为
无论主机具有的主机名。只有通过dig(dig + short $(hostname -f))可以解析
主机名,才会创建此文件。否则
您必须手动创建文件,并将其设置为您首选的
域。如果您的应用程序仍然不存在此文件,
dokku将以端口号(即
http: //example.com:49154 - 注意缺少的子域名。)
要解决这个问题,您将首先需要更新/ home / dokku / VHOST文件,添加域名 - 这将修复任何新生成的部署,但现有的应用程序需要从/ home / dokku目录中删除(/ home / dokku / foo, / home / dokku / bar等),并重新部署,以使此更改生效,因为每个Dokku应用程序在这些/ home / dokku /路径中都有一个单独的nginx.conf,那些将需要重写。
I installed Dokku on my Digital Ocean droplet, but did it before setting my dns records, so Dokku was installed on IP. Now I changed my dns record, so site can be accessed through site.com
. I can access my previously created Dokku containers through site.com:port
, how can I change Dokku settings to access my app like this - appname.site.com
Per https://github.com/progrium/dokku:
Set up a domain and a wildcard domain pointing to that host. Make sure /home/dokku/VHOST is set to this domain. By default it's set to whatever hostname the host has. This file is only created if the hostname can be resolved by dig (dig +short $(hostname -f)). Otherwise you have to create the file manually and set it to your preferred domain. If this file still is not present when you push your app, dokku will publish the app with a port number (i.e. http://example.com:49154 - note the missing subdomain).
To fix the issue, you will first need to update the /home/dokku/VHOST file, adding the domain name -- this will fix any newly generated deployments, but existing apps will need to be deleted from the /home/dokku directory by name (/home/dokku/foo, /home/dokku/bar, etc.) and redeployed for this change to take effect, since each Dokku application has a separate nginx.conf within those /home/dokku/ paths and those will need to be re-written.
这篇关于Dokku安装后更改设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!