Answer the question
In order to leave comments, you need to log in
LetsEncrypt Sertbot break config?
There was a simple config
upstream public-content-api {
server 127.0.0.1:9999;
}
server {
listen 80;
server_name api.example.com;
location / {
proxy_pass http://public-content-api;
include proxy_params;
}
}
upstream public-content-api {
server 127.0.0.1:9999;
}
server {
server_name api.example.com;
location / {
proxy_pass http://public-content-api;
include proxy_params;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = api.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name api.example.com;
return 404; # managed by Certbot
}
Answer the question
In order to leave comments, you need to log in
1.3. The generator should not be used from the word at all.
2. Throw out if, instead of return 404
sticking return 301 https://$server_name$request_uri
For beauty, HTTP and HTTPS can be combined into one location and wrap the redirect in if ($scheme = http)
.
3. To pass the test, it is enough to forward the directory with challenges. https://toster.ru/answer?answer_id=1326513
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question