Fix custom domains (#318)

* Configure trusted proxies
* Fix tenant signup route not working
* Use HTTP_X_FORWARDED_HOST if present
* Update reserved subdomains
This commit is contained in:
Riccardo Graziosi
2024-03-24 18:06:36 +01:00
committed by GitHub
parent d17b45c5c4
commit b63956a173
5 changed files with 16 additions and 8 deletions

View File

@@ -16,6 +16,12 @@ module App
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
# If configured, add trusted proxy to the list of trusted proxies
config.middleware.insert_after ActionDispatch::RemoteIp, Rack::Attack
if ENV["TRUSTED_PROXY"]
config.action_dispatch.trusted_proxies = ActionDispatch::RemoteIp::TRUSTED_PROXIES + [IPAddr.new(ENV["TRUSTED_PROXY"])]
end
def base_url
ENV["BASE_URL"]
end