--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/8c5c3abc-ef8d-4e56-9900-79773be9627fn%40googlegroups.com.
Hello,
It’s also possible that the reverse proxy is doing something to the Origin headers, but I have not touched IIS for a very long time, and never used it in a reverse proxy mode, so have no specific insight there - and to me doesn’t seem to explain the CSRF token errors. It also could be something not working as intended within GoCD.
I think it is related to the reverse proxy setup. I’ve seen this happen when setups ignore the “X-Forwarded-For” header setup shown in the documentation.
How it ends up being related to CSRF tokens seems to be:
Something like that. I could be mistaken. Related issue which reminded me of this (no resolutions mentioned there, unfortunately, apart from “proxy configuration was the issue”): https://github.com/gocd/gocd/issues/5296
Regards,
Aravind
Hello!
This helped me find the correct setting for my situation, although I don’t know if it’s a universal fix since I have a dedicated IIS install for the reverse proxies. I couldn’t find a way to get the reverse proxy itself to work properly but running the below command tells the ARR module to preserve the host headers instead of rewriting them.:
The command was:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy -preserveHostHeader:true /commit:apphost
Everything else I had tried just broke the proxy entirely.
Thanks for the help and this can be considered closed.
Thanks!
From: go...@googlegroups.com <go...@googlegroups.com> On Behalf Of Aravind SV
Sent: Tuesday, January 17, 2023 11:10 AM
To: go...@googlegroups.com
Subject: Re: [go-cd] Issues with saving xml on secure url with reverse proxy
Hello,
It’s also possible that the reverse proxy is doing something to the Origin headers, but I have not touched IIS for a very long time, and never used it in a reverse proxy mode, so have no specific insight there - and to me doesn’t seem to explain the CSRF token errors. It also could be something not working as intended within GoCD.
I think it is related to the reverse proxy setup. I’ve seen this happen when setups ignore the “X-Forwarded-For” header setup shown in the documentation.
How it ends up being related to CSRF tokens seems to be:
1. Server sends a response with a session ID in the cookie, along with a CSRF token to be sent back with the form response.
2. Due to the misconfiguration (could be secure site URL as you said), the cookie doesn’t get set / sent back with the form response.
3. Then, when the server tries to verify that the CSRF token sent back matches the one expected for the session, it doesn’t work, since the session won’t be the old session from point 1 above.
--
You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/NLBIV_xuRvE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/m25yd5uly4.fsf%40arvindsv.com.