server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;

    client_max_body_size 52m;

    location /static/ {
        alias /opt/forma-n8/static/;
        expires 30d;
        add_header Cache-Control "public, immutable";
        access_log off;
    }

    location /media/ {
        alias /var/lib/forma-n8/uploads/;
        expires 30d;
        add_header Cache-Control "public";
        add_header X-Content-Type-Options "nosniff";
    }

    location / {
        proxy_pass http://127.0.0.1:8090;
        proxy_http_version 1.1;
        proxy_set_header Host $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-Proto $scheme;
        proxy_read_timeout 60s;
    }
}
