2020-03-27 12:53:04 +01:00
|
|
|
server {
|
2020-04-28 15:53:56 +02:00
|
|
|
listen {http_port};
|
2020-03-27 12:53:04 +01:00
|
|
|
server_name {domain_name};
|
|
|
|
|
2020-04-09 16:33:26 +02:00
|
|
|
# Redirect to https
|
2020-03-27 12:53:04 +01:00
|
|
|
location / {
|
2020-04-28 15:53:56 +02:00
|
|
|
rewrite ^(.*) https://{domain_name}:{https_port}$1 permanent;
|
2020-03-27 12:53:04 +01:00
|
|
|
}
|
|
|
|
|
2020-04-09 16:33:26 +02:00
|
|
|
# letsencrypt
|
2020-03-27 12:53:04 +01:00
|
|
|
location /.well-known/acme-challenge/ {
|
|
|
|
root /var/www/certbot;
|
|
|
|
}
|
2020-04-09 16:33:26 +02:00
|
|
|
}
|