# Add to /root/n8n/nginx/nginx.conf
# Then run: docker restart n8n-nginx-1

server {
    listen 80;
    server_name dashboard.nerdbox.com;
    location /.well-known/acme-challenge/ { root /var/www/certbot; }
    location / { return 301 https://$host$request_uri; }
}

server {
    listen 443 ssl;
    server_name dashboard.nerdbox.com;

    ssl_certificate     /etc/letsencrypt/live/dashboard.nerdbox.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/dashboard.nerdbox.com/privkey.pem;
    ssl_protocols       TLSv1.2 TLSv1.3;
    ssl_ciphers         HIGH:!aNULL:!MD5;

    location / {
        proxy_pass         http://172.19.0.1:3456;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection 'upgrade';
        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;
    }
}
