How do I reconfigure top level routing on the DigitalOcean Dokku0.2.3/14.04 one-click application?

  • Posted April 30, 2014

I’m running into an odd issue with the one-click dokku installer where top level routing seems to be broken, or at least odd.

I’ve got DNS records of: A <myip> * A <myip>

When I push the first project to, suddenly ANY subdomain of, as well as the root, all route to this project. I’d have expected here that all subdomains except foobar don’t respond.

When I push a second project to, suddenly ANY subdomain of, as well as the root, all route to the SECOND, project, EXCEPT which routes to the first. From this point on, any further projects pushed seem to take over their designated subdomain only, as one would expect.

In contrast, I’ve got a manually installed dokku 0.2.3 on 14.04, and it exhibits the behavior where anysubdomainofmine will show an nginx default page, and subdomains corresponding to projects will show the proper project. This seems nominally correct to me, with the exception of the nginx “config required” page.

My REAL end goal is to have one project served at AS WELL AS (root), with other projects served at their respective subdomains. Has anyone achieved this, with or without the one-click droplet?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If I may ask, where do you add those DNS records? In your domain site (e.g., godaddy) or in Digital ocean droplet settings?

Yes, this solution works fine: <br> <br>STEP 1 <br> <br> <br>include /home/dokku/*/nginx.conf; <br> <br>#Add this lines <br>server { <br> listen 80; <br> server_name *; <br> <br> location / { <br> root html; <br> index index.html index.htm; <br> } <br>} <br>#To here <br> <br>ssl_session_cache... <br> <br> <br>STEP 2 <br> <br>Run “/etc/init.d/nginx restart” <br> <br>After these steps all works fine and apps only takes loaded on the specific sub-domain: [app-name] <br> <br>PS: Thank you everybody… <br>

Here’s a little more information about who nginx is configured on the one-click app. Each site/app has their own nginx configuration located in “/home/dokku/$YOUR_APP/nginx.conf” It will look like: <br> <br><pre> <br>upstream $YOUR_APP { server; } <br>server { <br> listen [::]:80; <br> listen 80; <br> server_name $YOUR_APP.$; <br> location / { <br> proxy_pass http://$YOUR_APP; <br> proxy_http_version 1.1; <br> proxy_set_header Upgrade $http_upgrade; <br> proxy_set_header Connection “upgrade”; <br> proxy_set_header Host $http_host; <br> proxy_set_header X-Forwarded-Proto $scheme; <br> proxy_set_header X-Forwarded-For $remote_addr; <br> proxy_set_header X-Forwarded-Port $server_port; <br> proxy_set_header X-Request-Start $msec; <br> } <br>} <br></pre> <br> <br>“/etc/nginx/conf.d/dokku.conf” then includes them all with: <br> <br><pre> <br>include /home/dokku/*/nginx.conf; <br></pre> <br> <br>

I would recommend pushing to an app called “” which will be served on the root domain. Then you could add a virtualhost manually to redirect traffic from to <br><pre>server { <br> listen 80; <br> server_name; <br> <br> return 301$request_uri; <br>}</pre> <br> <br>Let me know how it goes!