Skip to content

Conversation

@hunchr
Copy link
Member

@hunchr hunchr commented Jan 15, 2026

TICKET-23056

Discussed with @sislr

@hunchr hunchr requested review from coorasse and sislr January 15, 2026 08:29
@hunchr hunchr self-assigned this Jan 15, 2026
Copy link
Member

@coorasse coorasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do this on the app layer and not cloudflare?

@hunchr
Copy link
Member Author

hunchr commented Jan 15, 2026

Why do we do this on the app layer and not cloudflare?

I'd also prefer to configure it in Cloudflare tbh. But @sislr prefers it to be in the code rather than "hidden in Cloudflare"

@schmijos what's your opinion?

@hunchr hunchr requested a review from schmijos January 15, 2026 12:50
Comment on lines +49 to +52
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that what we want? If the env is set in staging/develop, then the deplo.io host redirects to renuoapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants