AzuraCast / AzuraCast

A self-hosted web radio management suite, including turnkey installer tools for the full radio software stack and a modern, easy-to-use web app to manage your stations.
https://www.azuracast.com/
GNU Affero General Public License v3.0
3.08k stars 568 forks source link

CORS #678

Closed RainbowDash53 closed 6 years ago

RainbowDash53 commented 6 years ago

Is your feature request related to a problem? Please describe. I use this: https://codecanyon.net/item/native-flash-radio/9672527/ for my radio but always I've problems with CORS shit (I'm French, I don't understand what is this)

Describe the solution you'd like Could you, add this on a future update? Install SSL in the same time that you install Apache or Ngnix, etc.

karndt84 commented 6 years ago

I have exactly the same problem, exactly with this script. CORS means Cross-Origin Resource Sharing. It probably needs to be activated in the nginx container CORS.

docker container ls (look how your nginx Container is named) docker exec -i -t azuracast_nginx_1 /bin/sh vi /etc/nginx/nginx.conf.default

I tried to use this:

https://enable-cors.org/server_nginx.html

The nginx container did not start after this change, unfortunately I no longer have the log.

It may also be that I was in the wrong config file

Maybe someone can help?

vdeville commented 6 years ago

Hello, Simply add add_header Access-Control-Allow-Origin "*"; If doesn't work, send me your full nginx config and the request uri. Thanks

karndt84 commented 6 years ago

Thank you very much! The correct configuration file is: /etc/nginx/conf.d/azuracast.conf under server { ... I added this and restart nginx.

Of course, the configuration will be overwritten at the next update, but so I can at least use CORS (-:

vdeville commented 6 years ago

You can map your nginx configuration to host path in docker-compose.yml.

karndt84 commented 6 years ago

Thanks! My Problem is now:

screen

I just added it in the first section of Server , maybe it´s wrong?

image

BusterNeece commented 6 years ago

@RainbowDash53 It appears this is a commercial add-on and I'm not sure exactly how it's connecting to the Shoutcast/Icecast server, so I don't know what it's missing as far as access control goes.

The Shoutcast/Icecast servers control their own CORS headers normally. This may be why you're seeing this error, @karndt84, because they're already setting the "*" header and nginx is trying to append to it rather than replace it.

I'd need to see a live demo of this in action to know what's going wrong.

vdeville commented 6 years ago

Hello, I missed it's to use with icecast/shoutcast stream. I think it was for the api. Yes shoutcast already inject this header.

BusterNeece commented 6 years ago

@MyTheValentinus As far as I know, AzuraCast sends the proper "Access-Control-Allow-Origin" headers across the application, with GET requests to the API being allowed globally. The Icecast and Shoutcast headers are all set and managed by the software themselves, so they can't necessarily be set by AzuraCast.

If there's some specific change that we need to make on our end, please let me know. Otherwise, I'm assuming this issue is unrelated to our software.