diff --git a/Dockerfile b/Dockerfile index e40eb6f..9aceb4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ FROM nginx:alpine ENV LISTEN_PORT="80" -ENV CONTAINER_PREFIX="container" +ENV CONTAINER_PREFIX="vscode" ENV CONTAINER_PORT="80" -ENV SPAWNER_HOST="spawner" -ENV SPANWER_PORT="80" +ENV SPAWNER_URL="http://container-spawner" RUN rm -rf /etc/nginx/conf.d/default.conf COPY director.conf /etc/nginx/templates/director.conf.template diff --git a/README.md b/README.md index 0e4394c..e7ec5dc 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,8 @@ services: restart: always environment: LISTEN_PORT: 80 - CONTAINER_PREFIX: "container" CONTAINER_PORT: 80 - SPAWNER_HOST: "spawner" - SPANWER_PORT: 80 + CONTAINER_PREFIX: "container" + SPAWNER_URL: "http://container-spawner" ... ``` diff --git a/director.conf b/director.conf index e521b81..f8a361a 100644 --- a/director.conf +++ b/director.conf @@ -5,11 +5,11 @@ server { resolver 127.0.0.11 valid=1s; location / { - proxy_pass http://${CONTAINER_PREFIX}$http_x_forwarded_preferred_username:${CONTAINER_PORT}$uri; + proxy_pass http://${CONTAINER_PREFIX}-$http_x_forwarded_preferred_username:${CONTAINER_PORT}$uri; error_page 502 = @spawner; } location @spawner { - proxy_pass http://${SPAWNER_HOST}:${SPANWER_PORT}$uri; + proxy_pass ${SPAWNER_URL}$uri; } }