6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-24 14:08:23 +00:00
Régis Behmo d0f02b7268 Re-add dependency of nginx to lms/cms
We re-introduce the dependency of the nginx container on the lms/cms
images. This dependency was removed to address a debugging scenario
which is actually not practical. Without this dependency, we are forced
to use an external docker-specific resolver which makes the local nginx
configuration incompatible with the kubernetes configuration.
2019-01-06 21:29:12 +01:00

37 lines
923 B
Plaintext

{% if ACTIVATE_NOTES %}
upstream notes-backend {
server notes:8000 fail_timeout=0;
}
{% 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;
proxy_pass http://notes-backend:8000;
}
}
{% endif %}