server {
    # Host configuration
    listen <ip>:80;
    listen [::]:80;
    server_name matrix-ident.domain.fqdn;

    access_log /var/log/nginx/matrix-ident.log;
    error_log /var/log/nginx/matrix-ident.error.log;

    gzip on;
    gzip_disable "msie6";

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    # Host configuration
    listen <ip>:443 http2 ssl;
    listen [::]:443 http2 ssl;
    listen <docker ip>:443 ssl http2;
    server_name matrix-ident.server.fqdn;
    
    access_log /var/log/nginx/matrix-ident.log;
    error_log /var/log/nginx/matrix-ident.error.log;

    # SSL configuration
    # Copy from https://ssl-config.mozilla.org/

    # Keys
    ssl_certificate /etc/letsencrypt/live/matrix-ident.server.fqdn/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/matrix-ident.server.fqdn/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
}