Question

add CORS to AzuraCast droplet

Hi, can I somehow add CORS to my Azura Cast Radio app? like that: Access-Control-Allow-Origin: *,

I found that function in the radio itself, but unfortunatly it didnt solved my problem that a website doesnt allow this radio anymore…


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 11, 2022

Hi there,

I don’t think that there is a good way to do that at the moment, as if you ever need to upgrade your instance using the self-update script that AzureCast provides at /var/azuracast/docker.sh all of your changes will be lost.

What I could suggest is requesting this as a feature, so that some of those Nginx changes could be configurable via the docker-compose yaml file for example.

As the image itself is supported by AzureCast, what you could do is post this as a feature request on the official repo here:

https://github.com/AzuraCast/AzuraCast

Alternatively, if you still want to make the change, you might be able to change the Nginx config directly:

  • Get the container ID:
docker ps -a | awk '{print $1}'
  • Access the container:
docker exec -i -t CONTAINER_ID bash
  • And then update the Nginx config at /etc/nginx/sites-available/default and add add_header Access-Control-Allow-Origin "*"; within the server { .. } block.

After that you would need to restart the container as well.

I would recommend taking a backup before making those changes!

Best,

Bobby