6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-04 19:03:39 +00:00

Allow nginx not to depend on lms/cms

By using variables in the nginx configuration to point to lms/cms, we
allow nginx not to require that lms and cms are up to run. This is
convenient for debugging production settings: just launch an nginx, then
runserver in an lms.
This commit is contained in:
Régis Behmo 2018-04-19 21:16:51 +02:00
parent 9ddc11a47b
commit 4252de9340
3 changed files with 15 additions and 17 deletions

View File

@ -38,8 +38,6 @@ services:
volumes:
- ./data/lms:/openedx/data/lms:ro
- ./data/cms:/openedx/data/cms:ro
depends_on:
- lms
rabbitmq:
image: rabbitmq:3.6.10
@ -77,7 +75,11 @@ services:
volumes:
- ./data/cms:/openedx/data
depends_on:
- lms
- memcached
- mongodb
- mysql
- rabbitmq
- smtp
############# LMS and CMS workers

View File

@ -1,7 +1,3 @@
upstream cms-backend {
server cms:8000 fail_timeout=0;
}
server {
listen 80;
server_name £{CMS_HOST};
@ -23,11 +19,13 @@ server {
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://cms-backend;
# Docker resolver
resolver 127.0.0.11 valid=10s;
set $upstream cms;
proxy_pass http://$upstream:8000;
}
location / {

View File

@ -1,7 +1,3 @@
upstream lms-backend {
server lms:8000 fail_timeout=0;
}
server {
listen 80;
server_name £{LMS_HOST};
@ -23,11 +19,13 @@ server {
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://lms-backend;
# Docker resolver
resolver 127.0.0.11 valid=10s;
set $upstream lms;
proxy_pass http://$upstream:8000;
}
location / {