2018-09-29 15:09:19 +02:00
|
|
|
{% if ACTIVATE_NOTES %}
|
2019-01-06 21:27:17 +01:00
|
|
|
upstream notes-backend {
|
|
|
|
server notes:8000 fail_timeout=0;
|
|
|
|
}
|
|
|
|
|
2018-09-29 15:09:19 +02:00
|
|
|
{% if ACTIVATE_HTTPS %}
|
|
|
|
server {
|
|
|
|
server_name notes.{{ LMS_HOST }};
|
|
|
|
listen 80;
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen {{ "443 ssl" if ACTIVATE_HTTPS else "80" }};
|
|
|
|
server_name notes.localhost notes.{{ LMS_HOST }};
|
|
|
|
|
|
|
|
{% if ACTIVATE_HTTPS %}
|
|
|
|
ssl_certificate /etc/letsencrypt/live/notes.{{ LMS_HOST }}/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/notes.{{ LMS_HOST }}/privkey.pem;
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
# Disables server version feedback on pages and in headers
|
|
|
|
server_tokens off;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_redirect off;
|
|
|
|
|
2019-01-07 07:40:30 +01:00
|
|
|
proxy_pass http://notes-backend;
|
2018-09-29 15:09:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endif %}
|