Issues with port forwarding for a web app, and 302/303 redirects #122720
-
Select Topic AreaBug BodyI'm developing a Clojure web site, and some forms POST some data and the backend then sends a redirect (any of 302, 303, 308). My backend listens on port 8000 So I have a url e.g. For some reason, my browser receives the following redirect url:
I've inspected the response from my app and it's sending only e.g. When I run the same app in production (with a Traefix proxy or a nginx proxy), there is no such issue with redirects, so I'm assuming there's something doing this in the Codespaces reverse proxy... When connecting to the Codespace in my VSCode desktop app and forwarding the port (to localhost:8000), there is of course no issue as well. Is there something that can be done about this? I'm willing to consider a misconfiguration in my app but so far everything I can see points to the Codespaces proxy adding this port for some reason.. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It appears, unless I'm premature here, that I found the solution and it was indeed a configuration issue. So I'm using the ring-defaults library. I had Once I set this to false, my redirects started working properly. Whew!!! As long as I set the :proxy true key and So far anyway this seems to have solved most if not all of my redirect issues... |
Beta Was this translation helpful? Give feedback.
-
Definitely resolved it as far as I can see 😌 |
Beta Was this translation helpful? Give feedback.
It appears, unless I'm premature here, that I found the solution and it was indeed a configuration issue.
So I'm using the ring-defaults library. I had
:site-defaults-config {... :responses {:absolute-redirects true} ...}
Once I set this to false, my redirects started working properly. Whew!!! As long as I set the :proxy true key and
{:security {:ssl-redirect true}}
as wellSo far anyway this seems to have solved most if not all of my redirect issues...