Nginx messing with file upload

I am using https://github.com/ZizzyDizzyMC/linx-server in order to try and run a file host at my server.
When uploading files via curl, it works flawlessly; however on the web ui the file upload instantly stops and the linx-server log shows

2022/03/15 20:25:05 [freedombox/xmK4IdbTt4-000022] Started POST "http://<server.ip>/files/upload" from <uploader.ip>:55532
2022/03/15 20:25:05 [freedombox/xmK4IdbTt4-000022] Returning 400 in 470.55µs

nginx config:

server {
        root /var/www/html;
        index index.html index.htm index.nginx-debian.html index.php;
        server_name 185.157.162.210;
        client_max_body_size 4096M;
        location /files {
                fastcgi_pass 127.0.0.1:9002;
                include fastcgi_params;
        }
}

linx-server config:

bind = 0.0.0.0:9002
selifpath = s
maxsize = 21470000000
maxexpiry = 5259492
allowhotlink = true
remoteuploads = true
nologs = false
force-random-filename = true
cleanup-every-minutes = 5
fastcgi = true
siteurl = /files/

I have tried many different combinations, it seems to be an issue with the siteurl parameter of linx-server, if I remove that and change the nginx config from /files to just / and access the server directly at <server.ip>, uploading works perfectly.
Any tips or suggestions are greatly appreciated!

Answer

Attribution
Source : Link , Question Author : PGBRULES , Answer Author : Community

Leave a Comment