Add container port number as an environment variable
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jack Hadrill 2022-08-24 22:26:20 +00:00
parent 9d6a888bb7
commit 70ecf3bf9b
3 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ FROM nginx:alpine
ENV LISTEN_PORT="80"
ENV CONTAINER_PREFIX="container"
ENV CONTAINER_PORT="80"
ENV SPAWNER_HOST="spawner"
ENV SPANWER_PORT="80"

View File

@ -16,6 +16,7 @@ services:
environment:
LISTEN_PORT: 80
CONTAINER_PREFIX: "container"
CONTAINER_PORT: 80
SPAWNER_HOST: "spawner"
SPANWER_PORT: 80
...

View File

@ -5,7 +5,7 @@ server {
resolver 127.0.0.11 valid=1s;
location / {
proxy_pass http://${CONTAINER_PREFIX}$http_x_forwarded_preferred_username$uri;
proxy_pass http://${CONTAINER_PREFIX}$http_x_forwarded_preferred_username:${CONTAINER_PORT}$uri;
error_page 502 = @spawner;
}