[SOLVED-AGAIN!] Airsonic 502 Bad Gateway error

    • OMV 5.x (beta)
    • Resolved
    • [SOLVED-AGAIN!] Airsonic 502 Bad Gateway error

      I install airsonic in docker. Receiving 502 Bad Gateway error. I am trying to use reverse proxy and letsencrypt to access airsonic from internet. Any help, please?

      This is my airsonic.subfolder.conf, which, I'm sure, is wrong

      Source Code

      1. # set the CONTEXT_PATH variable to /airsonic in airsonic container.
      2. location ^~ /airsonic {
      3. proxy_pass https://my url/airsonic;
      4. proxy_set_header X-Real-IP $remote_addr;
      5. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      6. # enable the next two lines for http auth
      7. #auth_basic "Restricted";
      8. #auth_basic_user_file /config/nginx/.htpasswd;
      9. # enable the next two lines for ldap auth, also customize and enable ldap.c$
      10. #auth_request /auth;
      11. #error_page 401 =200 /login;
      12. include /config/nginx/proxy.conf;
      13. resolver 127.0.0.11 valid=30s;
      14. set $upstream_airsonic airsonic;
      15. proxy_pass http://$upstream_airsonic:4040;
      Display All

      And my docker configuration

    • join airsonic in the network of the docker container an try this conf

      Source Code

      1. # set the CONTEXT_PATH variable to /airsonic in airsonic container.
      2. location ^~ /airsonic {
      3. # enable the next two lines for http auth
      4. #auth_basic "Restricted";
      5. #auth_basic_user_file /config/nginx/.htpasswd;
      6. # enable the next two lines for ldap auth, also customize and enable ldap.c$
      7. #auth_request /auth;
      8. #error_page 401 =200 /login;
      9. include /config/nginx/proxy.conf;
      10. resolver 127.0.0.11 valid=30s;
      11. set $upstream_airsonic airsonic;
      12. proxy_pass http://$upstream_airsonic:80;
      Display All
    • Morlan wrote:

      Did anything else change? Are airsonic and letsencrypt connected in a docker network? Does your airsonic container have the name airsonic?
      1. No, to the best of my knowledge
      2. Yes, I add Airsonic in nextcloud/letsencrypt yml
      3. Yes

      This is my airsonic.subdomain.conf


      Source Code

      1. # make sure that your dns has a cname set for airsonic and that your airsonic container is not using a base url
      2. server {
      3. listen 443 ssl;
      4. listen [::]:443 ssl;
      5. server_name airsonic.*;
      6. include /config/nginx/ssl.conf;
      7. client_max_body_size 0;
      8. # enable for ldap auth, fill in ldap details in ldap.conf
      9. #include /config/nginx/ldap.conf;
      10. location ^~ /airsonic {
      11. # enable the next two lines for http auth
      12. #auth_basic "Restricted";
      13. #auth_basic_user_file /config/nginx/.htpasswd;
      14. # enable the next two lines for ldap auth, also customize and enable ldap.c$
      15. #auth_request /auth;
      16. #error_page 401 =200 /login;
      17. include /config/nginx/proxy.conf;
      18. resolver 127.0.0.11 valid=30s;
      19. set $upstream_airsonic airsonic;
      20. proxy_pass http://$upstream_airsonic:80;
      21. }
      22. }
      Display All

      I have to make some general mistake. All my containers (except nextcloud) land at nginx welcome page when I join them to nextcloud network
    • gett wrote:

      Or maybe start all thing from scratch.

      OK, works now.

      Solution is silly. I start from scratch, Portainer and OMV 5.x
      All as usual, exept I call airsonic not from mydomain.com/airsonic, but from mydomain.com:4040/airsonic.
      Works like a charm. ?(

      Edited: This is true for local LAN: LOCALIP:4040/airsonic. For outside access I stil use MYDOMAIN/airsonic

      The post was edited 2 times, last by gett ().

    • Morlan wrote:

      Did you forward port 4040 on your router?
      No. I joined airsonic to my nextcloud network. forwarded are just 443 and 80, like in @macom guide.
      The thing is, when I access Aircloud from my local LAN, I am using LOCAL IP:port/airsonic thing, This morning discovered that from outside networks I have to use MYDOMAIN/airsonic, w/o port. I don't understand why, but it's working. Nginx conf in letsencrypt is enabled w/o any edits.

      And airsonic container is joined to Bridge AND nextcloud network in docker.