Changing the proxy host #117
-
Has anyone changing their proxy host with success? I have a staging server that is running 3 separate rails apps.
This all works fine. But I wanted to move app2 to staging.app2.com. Deploys fine, I can However, when I visit the domain, I get a too many redirects error. When I view the logs, a request to app2 matches app1 exactly except the I've tried removing the app with the old config, and then deploying the new config. I've rebooted kamal-proxy. I've restarted the server. I'm not sure what else to try. The mapping looks correctly. staging.app2.com maps to the right container ID and port. I can also revert the proxy config change and re-deploy and it works on the old host again. Has anyone ran into this or have suggestions on how to resolve? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@notnek I've not seen this before. What does the redirect response look like, is it literally redirecting back to the same location, or is there a loop involved? Also can you see these requests in your app logs as well? Kamal Proxy doesn't really issue redirects itself (other than to go from HTTP->HTTPS), so I'm wondering if these requests are reaching the app but somehow causing a redirect from there. The empty |
Beta Was this translation helpful? Give feedback.
Ah, I suspect Cloudflare is connecting to the proxy over plain HTTP, so the proxy is returning a redirect to HTTPS. But that HTTPS request again goes first to Cloudflare, which connects to the proxy over HTTP again, and so on.
If you want Cloudflare to do only DNS, you could turn off its proxy option to connect directly to Kamal Proxy instead.
But if you want to connect through Cloudflare, can you make sure your SSL mode is set to “Full (strict)”? It should work that way, as it'll use SSL end-to-end.
Let me know if that helps!