Easy way to configure Access-Control-Allow-Origin when using docker containers

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): 7.2.1
  • what are you trying to achieve: configure Access-Control-Allow-Origin

Dear All,

Is there an easy way to configure Access-Control-Allow-Origin if sonarqube is running in a docker container. For example: any property to set?

Thanks a lot,
Kumar

Hi Kumar,

Are you trying to achieve Cross-Origin Resource Sharing ? (CORS) If so the be aware that SonarQube does not support CORS.

What is your use-case for altering with Access-Control-Allow-Origin ?

Workaround: you may run a web server (e. g. nginx) before sq server, configure CORS headers there and proxy all request to SQ server.

Thanks. Sorry for delay, somehow went unnoticed. I wanted to get some data from sonarqube, to show them in our dashboard. However its sorted out now. Using a proxy to forward the request. All good! Thanks.

1 Like