Closed badmark closed 6 months ago
May you share your nginx config, so I can reproduce the issue?
I also get error accessing by it's local IP but I assumed that was because of the domain being passed into the docker.
Here is the Nginx config with domain redacted:
server {
server_name ********;
listen 80;
location ~ /.well-known
{
allow all;
root /usr/share/nginx/html;
}
location /{
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name *********;
real_ip_header X-Forwarded-For;
client_max_body_size 30M;
client_body_buffer_size 512M;
ssl_certificate /etc/letsencrypt/live/*******/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/*******/privkey.pem;
#ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
access_log /var/log/nginx/******.access.log;
error_log /var/log/nginx/******.error.log;
location / {
proxy_pass http://*.*.*.*:24750;
proxy_redirect off;
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;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_server_name on;
}
}
Thank you.
Here is a little update, for some reason fetch
does not recognize Connection
header when form-data
is submitted.
Hence the issue is in line:
proxy_set_header Connection "upgrade";
If I recall it right this header is used with websockets, so not sure whether it is needed here. For safety, I might just need to drop this header when it makes an API call.
That did the trick, thank you!
I dug a little bit more on this issue and it seems to be related to this nodejs/undici#1470.
In the next patch I intend just to strip unwanted headers from beeing passed to the API.
Running in a Docker container behind an Nginx reverse proxy, cannot upload images.
Client side error: