The Content Security Policy were introduced with 2.27. It seems quite strange that you’re url isn’t allowed by default, but you can fix it in the Admin module. It might seem rather complex to configure and the most used “fix” I have seen is to disable it.
If https://paituli-test.csc.fi is GeoServer’s proxy base URL but that is not the URL in your browser’s address bar, then you can try setting Inject proxy base URL into header to true. Otherwise, the easy options available with 2.27 would be to set Report violations without enforcement to true to see CSP violations without blocking anything or to set Enabled Content-Security-Policy header to false to completely disable CSP.
I had similar issues. Geoserver is also behind a proxy.
I ended up using the same example as sikeoka suggested to set Report violations without enforcement to false.
In my case Inject proxy base URL into header did not correct my CSP issue.
I am using the official docker image and tried mitigating with adding org.geoserver.web.csp.strict=false to the environment. Assuming that would do the same as the change in GUI. But it had no effect.
I also tried adding geoserver.csp.formAction='self' https://my.domain.com
Which also did not help in my case.
This is beyond my type of expertice, just want to report that I had she samme issue as ktiits and how i temporarily fixed it.
Your particular scenario has been discussed previously but I don’t know what the decision was from that since I can’t test this setup. Unfortunately, the https to http redirect on form submissions is considered to be insecure and blocked by CSP even when it is the same host (http to https redirects are okay).
The issue is that when the proxy uses http to pass the request to geoserver, geoserver will use http in the Location response header. You could either configure the proxy to modify the Location header or to use https to pass the request to geoserver. A quick search suggested something like proxy_redirect http:// https://; but I’ve never used nginx so I can’t confirm that this works.
geoserver.csp.formAction wasn’t backported to 2.27.x so it will only be available with the next geoserver version but I could try to backport it into 2.27.2.
Hi Kylli, great that you could find a solution to the problem.
Do you think that others could benefit from your findings? Do you have time to contribute a quick enhancement to the documentation that might save others days/weeks of frustration?
I would love it if you could update the documentation (upgrade link above) with your suggestion - all it takes is a GitHub account and following these instructions: Quickfix — GeoServer 2.28.x Documentation Guide
This is very specific usecase. Geoserver documentation does not mention even using nginx as proxy, less having such https/http redirects. So I do not think there is any good place for this in GeoServer documentation.
I hope people who need, would find it with some search engine. Just tried google and it found already this page.