Using the manual recommended Nginx SSL configuration I can't upload files

When I uncomment the ssl relative lines, I can’t upload files, otherwise, everytihng works as expected. My server is not connected to a public IP, becauuse we only need to access it from the internal lan.
My nginx conf file is:
log_format seafileformat ‘$http_x_forwarded_for $remote_addr [$time_local] “$request” $status $body_bytes_sent “$http_referer” “$http_user_agent” $upstream_response_time’;

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name server.example.ec;
access_log /var/log/nginx/seafile.com.access.log;
error_log /var/log/nginx/seafile.com.error.log;

rewrite ^ https://$http_host$request_uri? permanent; # Forced redirect from HTTP to HTTPS
server_tokens off; # Prevents the Nginx version from being displayed in the HTTP response header
#}
server {

listen 443;
server_name server.example.ec;
ssl on;
ssl_certificate /etc/letsencrypt/live/server.example.ec/fullchain1.pem; # Path to your fullchain.pem
ssl_certificate_key /etc/letsencrypt/live/server.example.ec/privkey1.pem; # Path to your privkey.pem
server_tokens off;
autoindex off;
client_max_body_size 100M;

location / {
proxy_pass http://{127.0.0.1}:8000;# I added {} symbols intentionally because can’t post links.
proxy_set_header Host $host;
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-Host $server_name;
proxy_read_timeout 1200s;
proxy_set_header X-Forwarded-Proto https;
# used for view/edit office file via Office Online Server
client_max_body_size 0;
}

location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://{127.0.0.1}:8082;I added {} symbols intentionally because can’t post links.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
}

location /media {
root /srv/seafile-server-latest/seahub;
}
}

Hi,

When you remove the comment symbols from the SSL-related lines in the nginx configuration file, a problem happens where file uploads they don’t work, even though other parts work fine.

This issue occurs even though the server is only reachable from the internal LAN and doesn’t have a public IP address.

The nginx setup has SSL settings for secure connections, but when you remove the comments from these lines, it messes up the file upload feature.

To fix this problem, you can take a few steps.

First, double-check that the paths for the SSL certificates in the nginx configuration are accurate.

Then, look into any network restrictions or firewall rules that could be causing problems with file uploads in the LAN setup.

Also, make sure that the permissions for file uploads are set up correctly in the server directories. Trying to clear your browser’s cache and cookies might also help solve any issues on the user side.

Follow these steps, you can resolve the file upload problem on the nginx server, ensuring smooth operation while keeping SSL security for connections within the internal LAN.

Hope is clear now.