server {
    listen %%interface%%:%%port%% default_server;

    # include /etc/nginx/includes/server_params.conf;
    # include /etc/nginx/includes/proxy_params.conf;

    add_header         X-Frame-Options SAMEORIGIN;
    access_log         /dev/stdout;
    error_log          /dev/stderr;
    # proxies
    # Docs for using variables to force name re-resolution when upstream        containers are re-created.
    # https://tenzer.dk/nginx-with-dynamic-upstreams/
    # proxy_buffering off;
    # proxy_buffers     8 64k;
    proxy_set_header   Host $http_host;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
    proxy_set_header   X-Forwarded-Port $server_port;
    proxy_set_header   X-Forwarded-Proto $scheme;
    # proxy_set_header  X-Forwarded-Ssl   on;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Scheme $scheme;
    # WS
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection "Upgrade";
    gzip_comp_level    6;
    gzip_proxied       any;
    gzip_types         text/plain text/css text/js text/xml text/javascript
      application/javascript application/json application/xml image/svg+xml;

    location / {
       proxy_pass         %%protocol%%://backend;
    }
}
