We had similar problems with csrfguard and found that our proxy server incorrectly returns the URL-address Referer. In addition to this, we used SSL, which added additional problems. We found that as soon as the connection was made, it was done using "domain.tld" instead of "domain.tld: 443", which was expected by csrfguard.
Referer domain https://localhost/shop/pages/main.jsf does not match request domain: https://localhost:443/shop/JS/csrfguard.js
We fixed this by adding it in the apache httpd config:
Header edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5" RequestHeader edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5" s):? // ([\ w] + \) { Header edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5" RequestHeader edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5" ) +..?) $ (*.)" "$ Header edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5" RequestHeader edit Referer "(^http(s?)://([\w]+\.){1}([\w]+\.?)+)(.*)$" "$1:443$5"
Since all requests come from https, we recorded the presence of the port in the URI that. I believe that your case can be corrected in the same way or by setting the header "Referer" for a predefined name. (But this may be a security problem here, because all the requests will come from the "right" domain)
source share