Render the header inside location / so it is not dropped by other location headers; remove the ineffective server-level directive.
27 lines
588 B
Plaintext
27 lines
588 B
Plaintext
server {
|
|
listen 80;
|
|
server_name ${CLEARNET_DOMAIN} www.${CLEARNET_DOMAIN};
|
|
|
|
access_log off;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name ${CLEARNET_DOMAIN} www.${CLEARNET_DOMAIN};
|
|
|
|
access_log off;
|
|
|
|
ssl_certificate /etc/nginx/certs/live/${CLEARNET_DOMAIN}/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/live/${CLEARNET_DOMAIN}/privkey.pem;
|
|
|
|
include /etc/nginx/snippets/private-image-locations.conf;
|
|
}
|