linuxserver / docker-airsonic

GNU General Public License v3.0
37 stars 8 forks source link

Subdomain Reverse proxy no to port 443 #30

Closed g2ufo closed 3 years ago

g2ufo commented 4 years ago

I am using  linuxserver/letsencrypt with configuring reverse proxy to port 9999 ( https://subdomain.domain.my:9999 ), but airsonic redirect always to https://subdomain.domain.my/login and does not show login page (it is empty).

airsonic docker run with JAVA_OPTS -Dserver.use-forward-headers=true .

nginx airsonic.subdomain.conf from linuxserver/letsencrypt:

server { listen 9999 ssl; listen [::]:9999 ssl;

server_name subdomain.*;

include /config/nginx/ssl.conf;

client_max_body_size 0;

add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.gstatic.com; img-src 'self' *.akamaized.net; style-src 'self' 'unsafe-inline' fonts.googleapis.com;$

location / {
     include /config/nginx/proxy.conf;
    resolver 192.169.44.1 valid=30s;
    set $upstream_airsonic subdomain.domain.my;
    proxy_pass http://$upstream_airsonic:4040;

proxy_max_temp_file_size 0; } }

And proxy.conf from linuxserver/letsencrypt docker:

client_body_buffer_size 128k;

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

Advanced Proxy Config

send_timeout 5m; proxy_read_timeout 240; proxy_send_timeout 240; proxy_connect_timeout 240;

proxy_set_header Early-Data $ssl_early_data;

proxy_set_header Host $host; 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-Ssl on; proxy_redirect http:// $scheme://; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_cache_bypass $cookie_session; proxy_no_cache $cookie_session; proxy_buffers 32 4k; proxy_headers_hash_bucket_size 128; proxy_headers_hash_max_size 1024;

g2ufo commented 4 years ago

Other proxy works fine with the same settings (for example jellyfin and others)

BobWs commented 4 years ago

Have you tried to add this to the airsonic.properties file? server.use-forward-headers=true

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.