mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
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:
committed by
GitHub
parent
d17b45c5c4
commit
b63956a173
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user