Skip to content

Wrong redirection with reverse-proxy setup (nginx) to other port/site #635

@nRaecheR

Description

@nRaecheR

I'm trying to update from Airsonic-Advanced v10.6.0 to v11 (Docker Tag Latest from 27.9.2021). The installation works as expected when accessed directly through port 4040. When accessed through the reverse-proxy (port 8181), which has worked with Airsonic for years, the browser will be redirected to the default site of the webserver (port 443). Here's the proxy configuration of nginx:

# vim: set autoindent smartindent ts=4 sw=4 sts=4 noet filetype=nginx:

server {
        listen 8181 ssl http2;

        server_name sub.domain.tld;

        include /config/nginx/ssl.conf;

        location / {
                proxy_set_header Upgrade           $http_upgrade;
                proxy_set_header Connection        "Upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Real-IP         $remote_addr;
                proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-Host  $http_host;
                proxy_set_header Host              $http_host;
                proxy_max_temp_file_size           0;
                proxy_pass                         http://<localip-of-server>:4040/;
                proxy_redirect                     http:// https://;
                proxy_buffering 		   off;
                proxy_request_buffering            off;
                proxy_set_header Origin            '';
                client_max_body_size               0;
                }
}

The docker container will be started with this parameter added:

-e "JAVA_OPTS=-Xmx2048m -Dserver.forward-headers-strategy=native"

The installation was migrated from Airsonic 10.6.0 to Airsonic-Advanced before. This migration has worked as expected. The redirection works with the reverse-proxy setup with 10.6.2 too.

Steps to reproduce

  1. Setup Airsonic-advanced "latest" as Podman container
  2. Setup nginx "latest" as Podman container
  3. Use site configuration above
  4. Access the web-UI through sub.domain.tld:8181
  5. Login to site

The browser gets redirected to the default page of https://sub.domain.tld

System information

  • Airsonic version: Docker "Latest" version from 27.9.2021
  • Operating system: Podman 3.20 on Ubuntu 21.04, AMD64
  • Java version: From Docker "Latest" version from 27.9.2021
  • Proxy server: NGINX Docker Container, latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions