server {
    server_name  www.{{ domain }};
    rewrite ^(.*) http://{{ domain }}$1 permanent;
}

server {
    listen 80;
    listen [::]:80;
    server_name {{ domain }};
    access_log /var/log/nginx/{{ domain }}.log;
    error_log  /var/log/nginx/{{ domain }}-error.log error;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:3000;
        proxy_redirect off;
        client_max_body_size 10M;
    }
}