map $host $auth { default auth; }

server {
    listen      80;
    listen      [::]:80;
    server_name auth.shore.co.il;
    include     snippets/robots-disallow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/www-acme-challenge.conf;
    include     snippets/redirect-https.conf;
}

server {
    listen      443 ssl http2;
    listen      [::]:443 ssl http2;
    server_name auth.shore.co.il;
    include     snippets/robots-disallow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/ssl.conf;

    location / {
        proxy_pass              http://$auth:8080$request_uri;
        proxy_http_version      1.1;
        include                 snippets/proxy-headers.conf;
        include                 snippets/allow-shore-ips.conf;
    }
}
