I have a jhipster generated application where I want to add a websocket. Locally everything works, but on the server I'm getting CSP errors. How can this be resolved? I tried adding
<meta http-equiv="Content-Security-Policy" content="connect-src *;">
to index.html but it does not help. Nginx is in front of the application as a proxy.
In Spring Boot, the CSP is set in java not in index.html, this is why your change had no impact.
If you look at SecurityConfiguration.java in your generated project, you'll see this line:
.contentSecurityPolicy(jHipsterProperties.getSecurity().getContentSecurityPolicy())
It means that the CSP is directly copied from application properties under jhipster.security.content-security-policy key.
So, just edit application.yml to change it.