okumy/aiohttp-tus

No port forwarding in Location header

Closed this issue · 0 comments

I'm using aiohttp-tus behind nginx. here is my nginx config:

location ~ ^/uploads.*$ {
         proxy_pass http://localhost:7010;
         proxy_request_buffering off;
         proxy_buffering off;
         proxy_http_version 1.1;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-Host $host;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Port $server_port;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         client_max_body_size 0;
      }

Now I'm trying an upload via tusjs-client in my angular 11 application running on a specific port locally.
The POST works as expected.
The following upload requets seem to work for default port 443.
But if I'm run my application on a different port the Location header on upload response is wrong because the port is missing in URL.

Is this a bug or something missing in my nginx config?