Conversation
coorasse
left a comment
There was a problem hiding this comment.
Why do we do this on the app layer and not cloudflare?
| if (app_host = ENV["APP_HOST"]).present? | ||
| match "*path", constraints: ->(req) { req.host != app_host && !req.path.start_with?("/.well-known/") }, | ||
| to: redirect { |_params, req| "https://#{app_host}#{req.fullpath}" }, via: :all | ||
| end |
There was a problem hiding this comment.
| if (app_host = ENV["APP_HOST"]).present? | |
| match "*path", constraints: ->(req) { req.host != app_host && !req.path.start_with?("/.well-known/") }, | |
| to: redirect { |_params, req| "https://#{app_host}#{req.fullpath}" }, via: :all | |
| end | |
| if (canonical_host = ENV["CANONICAL_HOST"]).present? | |
| match "*path", constraints: ->(req) { req.host != canonical_host && !req.path.start_with?("/.well-known/") }, | |
| to: redirect { |_params, req| "https://#{canonical_host}#{req.fullpath}" }, via: :all | |
| end |
I'd rather use a separate ENV variable here. APP_HOST is in most cases also set in staging apps AFAIK
There was a problem hiding this comment.
Isn't that what we want? If the env is set in staging/develop, then the deplo.io host redirects to renuoapp.
|
I prefer to have this things in code as well if feasible. Consider the example here: https://renuo.slack.com/archives/C18D5LVDF/p1768293590120929
Cloudflare needs a domain to point to somewhere for it to be proxyable.
It seems that DNS is not powerful enough for what people want to do. |
|
Okay, should we merge it then? This PR received three comments, but no approvals or requested changes. |
fbc36c2 to
71b2e63
Compare
|
I still think this causes unnecessary load on our app. it should rather be on ngnix, but having the app responsible of jiggling with the domains still does not seem right to me: the app should not really care about the domains it responds to. |
TICKET-23056
Discussed with @sislr