Dokku-设置后添加域 [英] Dokku - Add domain after setup

查看:56
本文介绍了Dokku-设置后添加域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Digital Ocean Droplet上安装了Dokku,但在设置dns记录之前就安装了Dokku,因此Dokku已安装在IP上.现在,我更改了dns记录,因此可以通过 site.com 访问该站点.我可以通过 site.com:port 访问以前创建的Dokku容器,如何更改Dokku设置以访问我的应用程序- appname.site.com

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

推荐答案

https://github.com/progrium/dokku:

设置一个指向该主机的域和一个通配符域.确保/home/dokku/VHOST设置为此域.默认情况下,它设置为主机拥有的任何主机名.仅在以下情况下创建此文件:主机名可以通过dig(dig + short $(hostname -f))解析.除此以外您必须手动创建文件并将其设置为您的首选领域.如果您在推送应用程序时此文件仍然不存在,dokku将发布带有端口号的应用程序(即 http://example.com:49154 -请注意缺少的子域).

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).

要解决此问题,您首先需要更新/home/dokku/VHOST文件,并添加域名-这将解决所有新生成的部署,但是现有应用将需要从/home/中删除将dokku目录按名称(/home/dokku/foo,/home/dokku/bar等)重新部署以使此更改生效,因为每个Dokku应用程序在/home/dokku/路径和这些将需要重新编写.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆