Skip to content

example: nginx local block configuration using websockets for airsonic-advanced #145

@jobenvil

Description

@jobenvil

This is related to the websockets closed issue.

Since I had the same issue and I came up configuring nginx in the following way:

        ###
        # airsonic-advanced
        ###

    location /airsonic {
        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  $host;
        proxy_set_header X-Forwarded-Port  $server_port;
        proxy_set_header Host              $host;
        proxy_max_temp_file_size           0;
        proxy_pass                         http://192.168.178.90:8070;
        proxy_redirect                     http:// https://;
        proxy_buffering off;
        proxy_request_buffering off;
        
        client_max_body_size 0;

        access_log      /var/log/nginx/airsonic_access.log;
        error_log       /var/log/nginx/airsonic_error.log;
       #access_log      off;
    }

This config give the best output results and no warning or errors on chrome inspect console.

remarks: airsonic-advanced is not running on the same nginx server. airsonic-advanced running on 192.168.178.90:8070

Maybe could be from any help to others ussing the websockets used by airsonic advanced.

Updated: 25.01.2021 - added proxy_set_header Origin '';
Updated: 27.09.2021 - deleted the added line on 25.01.2021 proxy_set_header Origin ''; See #145 (comment)
Updated: 05.10.2021 - added proxy_set_header X-Forwarded-Port $server_port; since nginx could listen in other ports than 443, see #635
Updated: 12.12.2021 - changed proxy_set_header Host $http_host; to proxy_set_header Host $host; and proxy_set_header Host $http_host; to proxy_set_header Host $host; See #145 (comment)

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