Question
NGINX LetsEncrypt Cert location tag question
server {
listen 80;
listen [::]:80;
server_name www.domain.com *.domain.com;
return 301 http://domain.com;
}
server {
listen 80;
listen [::]:80;
root /var/www/domain.com/html;
index index.html index.htm index.nginx-debian.html;
server_name domain.com;
location / {
try_files $uri $uri/ =404;
}
}
The tutorial says to add to the SSL Server Block
location ~ /.well-known {
allow all;
}
so i updated mine to be:
server {
listen 80;
listen [::]:80;
server_name www.domain.com *.domain.com;
return 301 http://domain.com;
}
server {
listen 80;
listen [::]:80;
root /var/www/domain.com/html;
index index.html index.htm index.nginx-debian.html;
server_name domain.com;
location ~ /.well-known {
allow all;
}
location / {
try_files $uri $uri/ =404;
}
}
I was just wondering if this is the proper way to do it or if there is a better way to do it?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×