psi-4ward / psitransfer

Simple open source self-hosted file sharing solution.
BSD 2-Clause "Simplified" License
1.48k stars 216 forks source link

ssl nginx reverse proxy upload file error #180

Closed kingzleshe closed 3 years ago

kingzleshe commented 3 years ago

Not sure if it is my setting issues or docker image issues

host : Raspberry Pi 4 docker image : hbuilder/psitransfer_arm docker image nginx:alpine as reverse proxy

http direct access psitransfer in same subnet download and upload no problem

https access with DDNS from outside through a reverse proxy download no problem, upload report error as blow: tus: unexpected response while uploading chunk, originated from request (method: PATCH, url: /files/30a796c4ad37++3328aa52-807e-4318-b0b1-cb72149627a3, response code: 413, response text: <html> <head><title>413 Request Entity Too Large</title></head> <body> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx/1.21.0</center> </body> </html> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> , request id: n/a)

my nginx conf file

server {
    listen       443 ssl;
    server_name  www.mydomain.com localhost;
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    ssl_certificate "/etc/nginx/conf.d/full_chain.pem";
    ssl_certificate_key "/etc/nginx/conf.d/private.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_send_timeout  30;
        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_pass  http://192.168.1.1:3000;
        proxy_read_timeout  90;
        proxy_redirect      http://192.168.1.1:3000 https://www.mydomain.com;
    }
}
kingzleshe commented 3 years ago

solved

client_max_body_size 0;

add to nginx conf