diff --git a/conf/.env b/conf/.env index a5c103e..7d7f328 100644 --- a/conf/.env +++ b/conf/.env @@ -8,7 +8,7 @@ PORT=__PORT__ DB_DIR=__FINALPATH__/distbin-db # The external URL -EXTERNAL_URL=https://__DOMAIN_URI__ +EXTERNAL_URL=https://__DOMAIN_URI__/ # The internal URL INTERNAL_URL=http://localhost:__PORT__/ diff --git a/conf/nginx.conf b/conf/nginx.conf index 7cf6397..625b100 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,9 +6,14 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } + rewrite ^/distbin/(.*) /$1 break; proxy_pass http://127.0.0.1:__PORT__/; - proxy_set_header Host $host; - # proxy_buffering off; + proxy_pass_request_headers on; + proxy_redirect ~^/(.*) $scheme://$http_host/distbin/$1; + proxy_set_header Host $http_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 $scheme; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc;