# Port 80 for {{EDGE_DOMAIN}}: ACME http-01 challenges and the redirect to # HTTPS. This is the only file needed to obtain the first certificate. # # Rendered from deploy/edge/nginx/lincodex-http.conf.template. server { listen {{EDGE_LISTEN_IP}}:80; server_name {{EDGE_DOMAIN}}; server_tokens off; access_log /var/log/nginx/lincodex.access.log lincodex; # Certbot writes challenge files here (webroot method). Nothing else is # served from this directory. location ^~ /.well-known/acme-challenge/ { root {{EDGE_ACME_WEBROOT}}; default_type text/plain; try_files $uri =404; } # The target uses the configured name, not $host, so a forged Host header # cannot turn the redirect into an open redirect. location / { return 301 https://{{EDGE_DOMAIN}}$request_uri; } }