0

I am trying to set up a web radio environment called AzuraCast. I'm using a provided docker installation script which sets up multiple containers:

  • a web server container
  • a "stations" container
  • an nginx proxy which is supposed to work as a so-called reverse proxy to access the web container
  • a mariadb container
  • and some other stuff which is not of interest for now.

On my server I am running an apache2 docker container (php:apache) which I have set up reverse proxies on to access other docker containers I have installed (e.g. nextcloud, airsonic, ...):

<IfModule mod_ssl.c>
<VirtualHost *.443>

# ...

    ProxyPass /audio http://airsonic:4040/audio
    ProxyPassReverse /audio http://airsonic:4040/audio

    ProxyPass /nextcloud http://nextcloud
    ProxyPassReverse /audio http://nextcloud

    ProxyPass /git http://git:3000
    ProxyPassReverse /git http://git:3000

# ...
</VirtualHost>
</IfModule>

Now, when I want to access the web container of the AzuraCast installation, on my server I only need to access http://localhost:8298 (8298 being the HTTP port I am using since 80 is already being used by my apache2 container). However, if I want to create a reverse proxy for the AzuraCast web frontend I would assume I just had to add

    # since the container-internal HTTP port from the nginx proxy is still 80, there's no need to specify a port here
    ProxyPass /radio http://azuracast_nginx_proxy_1
    ProxyPassReverse /radio http://azuracast_nginx_proxy_1

However, when I'm now trying to access the AzuraCast backend via my reverse proxy at https://my.domain/radio, I am able to access the page but none of the pictures or links work which makes me wonder if there's something like a context path needed or if maybe the proxy pass hasn't been configured correctly. here's what the backend looks like:

Backend with missing images etc.

And here is what it's supposed to look like:

Correct backend design

Now my question is:

Am I supposed to set something like an environment variable? Neither links nor pictures work because the backend proxy does not add the /radio path to the links provided by the website so the path which is supposed to look like this https://my.domain/radio/login only looks like this https://my.domain/login.

Thanks a lot in advance.

2 Answers 2

1

Neither links nor pictures work because the backend proxy does not add the /radio path to the links provided by the website[.]

The simplest answer may be to try using a separate subdomain (a virtual host in Apache or server block in Nginx, respectively) rather than e.g. /radio. So, for example, in Apache something like:

<IfModule mod_ssl.c>
    <VirtualHost *:443>

        ServerName radio.example.com
        # ServerAlias radio.localhost
        # DocumentRoot "/www/unneeded"

        ProxyPass / http://azuracast_nginx_proxy_1/
        ProxyPassReverse / http://azuracast_nginx_proxy_1/

        # ...

    </VirtualHost>
</IfModule>

Let's Encrypt

Note that for Let's Encrypt HTTP verification, you'll likely need a separate, non-forwarded subdomain on port 80:

<VirtualHost *:80>

    ServerName radio.example.com
    # ServerAlias radio.localhost
    DocumentRoot "/www/http-auth-folder"

</VirtualHost>

You should be able to use an index page with a meta refresh of ex. 0 at the root of e.g. /www/http-auth-folder if you wish to automatically redirect browsers to the HTTPS version of your site without interfering with Let's Encrypt queries.

4
  • that sounds like a reasonable thing to do, I'll give that a try.
    – tai
    Commented Dec 12, 2020 at 16:01
  • So I tried this and added a subdomain entry on my domain manager radio.example.com which points to / but now I am getting SSL issues since I don't have a Let's Encrypt certificate for the subdomain. I tried to obtain one however I keep getting errors Failed authorization procedure. radio.example.com (http-01): urn:ietf:params:acme:error:unauthorized. Am I missing something here or did I get a step too far on this?
    – tai
    Commented Dec 12, 2020 at 16:34
  • I have updated my answer. It sounds like Let's Encrypt can't verify the .well-known/challenge URL for HTTP verification. I would suggest creating a second virtual host with the same subdomain (radio.example.com) on port 80 with a normal document root and no Apache-based forwarding. Commented Dec 12, 2020 at 17:54
  • Thanks for the effort @Anaksunaman, however that won't seem to work, I am still getting the same error.
    – tai
    Commented Dec 13, 2020 at 16:56
0

make your application aware it will be referenced using the radio directory. I would put it in a radio directory, and configure the application to know it will be ran from a radio directory. Then the proxypass* will work as expected.

3
  • If I knew a way of telling my application it will be referenced using a directory I would have tried it, however there doesn't seem to be one.
    – tai
    Commented Dec 11, 2020 at 10:06
  • I just checked their git repository, they have an env file example: github.com/AzuraCast/AzuraCast/blob/master/azuracast.dev.env in that there is a INIT_BASE_URL, I would change that to the <hostname>/radio location, so every url ends up with that base, then everything should work.
    – NiteRain
    Commented Jan 23, 2021 at 16:22
  • good call, however that didn't change anything. I still get redirected to false urls, e.g. if I type <hostname>/radio it should redirect me to <hostname>/radio/login however I keep getting redirected to <hostname>/login.
    – tai
    Commented Feb 5, 2021 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .