mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 16:46:51 +02:00
Enable updating nginx configuration after certbot run
This commit is contained in:
@@ -11,6 +11,8 @@ server {
|
||||
{% for app in spring_apps %}
|
||||
{% if app.expose %}
|
||||
location {{ app.path }} {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://localhost:{{ app.port }};
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
server {
|
||||
|
||||
server_name {{ spring_domain }};
|
||||
|
||||
location ^~ /.well-known/acme-challenge/ {
|
||||
default_type "text/plain";
|
||||
}
|
||||
|
||||
{% for app in spring_apps %}
|
||||
{% if app.expose %}
|
||||
location {{ app.path }} {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://localhost:{{ app.port }};
|
||||
}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
||||
listen 443 ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/{{ spring_domain }}/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ spring_domain }}/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 = {{ spring_domain }}) {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name {{ spring_domain }};
|
||||
return 404; # managed by Certbot
|
||||
}
|
||||
Reference in New Issue
Block a user