7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-25 16:32:35 +00:00
tutor/tutor/templates/local/proxy/nginx/openedx.conf
Régis Behmo 2234510cfb Make it possible to configure the notes service hostname
This is important, in particular in development.
2019-05-15 10:52:45 +02:00

71 lines
2.0 KiB
Plaintext

server {
listen 80;
server_name {{ LMS_HOST }} preview.{{ LMS_HOST }} {{ CMS_HOST }};
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://localhost:{{ NGINX_HTTP_PORT }};
}
}
{% if ACTIVATE_HTTPS %}
server {
listen 443 ssl;
server_name {{ LMS_HOST }} preview.{{ LMS_HOST }} {{ CMS_HOST }};
ssl_certificate /etc/letsencrypt/live/{{ LMS_HOST }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ LMS_HOST }}/privkey.pem;
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://localhost:{{ NGINX_HTTPS_PORT }};
}
}
{% endif %}
{% if ACTIVATE_NOTES %}
server {
listen 80;
server_name {{ NOTES_HOST }};
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://localhost:{{ NGINX_HTTP_PORT }};
}
}
{% if ACTIVATE_HTTPS %}
server {
listen 443 ssl;
server_name {{ NOTES_HOST }};
ssl_certificate /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem;
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://localhost:{{ NGINX_HTTPS_PORT }};
}
}
{% endif %}
{% endif %}