From 4c57e11d8fefc4215cc523f435c93963fa90ebe5 Mon Sep 17 00:00:00 2001 From: Alex Pounds Date: Wed, 19 Feb 2025 17:44:11 -0500 Subject: [PATCH] Document problem (and solution) for mis-routing apps related to SSL config. --- docs/getting-started/troubleshooting.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/troubleshooting.md b/docs/getting-started/troubleshooting.md index 0645869dd..e234afbc2 100644 --- a/docs/getting-started/troubleshooting.md +++ b/docs/getting-started/troubleshooting.md @@ -226,11 +226,20 @@ sudo ufw disable ### I can't connect to my application because the server is sending an invalid response, or can't provide a secure connection -This isn't usually an issue with Dokku, but rather an app config problem. This can happen when your application is configured to enforce secure connections/HSTS, but you don't have SSL set up for the app. +This is normally a config problem with your app, rather than an issue with Dokku. -In Rails at least, if your `application.rb` or `environmnents/production.rb` include the line `configure.force_ssl = true` which includes HSTS, try commenting that out and redeploying. +One common cause is an application configured to enforce secure connections/HSTS, but SSL is not set up. In Ruby on Rails, if your `application.rb` or `config/environments/production.rb` include the line `configure.force_ssl = true`, try commenting that line out and redeploying. If this solves the issue temporarily, longer-term you should consider [configuring SSL](/docs/configuration/ssl.md). + + +### I deployed a new application, but an existing application is being served when I visit it + +This problem has the same cause as the previous issue: your application is attempting to enforce SSL, but SSL is not configured. Disabling SSL enforcement should solve the problem. + +The underlying cause is best understood with an example. Let's say you already have `https://apples.example.com/` working, and you're trying to deploy `bananas.example.com/`. But whenever you visit `bananas.example.com` you see `apples.example.com` instead. This is caused by `bananas.example.com` forcing SSL: +1. Your browser sends a request to `http://bananas.example.com`. +1. `bananas.example.com` issues a redirect to `https://bananas.example.com`. +1. Your browser sends a request to `https://bananas.example.com`. But you haven't configured SSL for `bananas.example.com` yet! So this request ends up routed to `https://apples.example.com`, which _does_ have an SSL config. -If this solves the issue temporarily, longer term you should consider [configuring SSL](/docs/configuration/ssl.md). ### My application deploys properly, but won't load in browser "connection refused"