Java EE / JSF and Nginx: uploading files fails when server behind Nginx

with JSF 2.3, Jakarta EE 8 and Wildfly 23 / Payara 5

Uploading a file with <h:input> or <p:fileUpload> works fine but fails when Nginx is turned on. The file is never received by the backing bean.

  1. is there any configuration to add to the server? (Payara or Wildfly)
  2. the Nginx config file has surely errors in it?


upstream payara{

    server localhost:8080 max_fails=3 fail_timeout=5s;
    server localhost:8181 max_fails=3 fail_timeout=5s;
server {
    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen        80;
    access_log /var/log/nginx/payara-access.log;
    error_log /var/log/nginx/payara-error.log;
    #Replace with your domain
    return        301 https://$host$request_uri;


server {
    listen        443 ssl;
    ssl_certificate /etc/letsencrypt/live/xxxxx/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/xxxxx/privkey.pem; # managed by Certbot

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    location /nocodeapp-web-front-1.0 {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto https;
            proxy_connect_timeout      240;
            proxy_send_timeout         240;
            proxy_read_timeout         240;  
            proxy_http_version 1.1;

            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_pass http://payara$request_uri;
    location = / {
            proxy_pass http://payara;
            return 301;