rjunior
rjunior

Reputation: 101

Same domain hosting of both static landing page and Rails app on sub-uri with Dokku

I currently have the following scenario on one of my VPSs:

Need to migrate both to a new server as Dokku apps and that should result in two apps: one for the static landing page and one to the Rails app. Is that even possible? If yes, any tips?

Thanks!

Upvotes: 0

Views: 351

Answers (1)

rjunior
rjunior

Reputation: 101

Got it working by setting a reverse proxy on the landing page app's nginx config file, pointing to the main app:

  • Disable VHOST support on main app, since it won't be reachable outside or by a domain name. This will create a local listening container on a high numbered port
  • Add a proxy.conf file to /home/dokku/landing-page/nginx.conf.d/
  • Set up a reverse proxy on a 'location /app/' block inside that file. Set the upstream to the main app's IP and PORT (from the first item).

That's the main steps. Had to tweak forwarded headers a bit to get SSL working fine, but it works fine!

Upvotes: 1

Related Questions