diff --git a/docker-compose.yml b/docker-compose.yml index 7842a63..f94ef4c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: depends_on: - backend-a - backend-b + - backend-c ports: - "8080:80" volumes: @@ -24,3 +25,9 @@ services: container_name: workshop-backend-b volumes: - ./backends/b:/usr/share/nginx/html:ro,z + + backend-c: + image: nginx:1.27-alpine + container_name: workshop-backend-c + volumes: + - ./backends/c:/usr/share/nginx/html:ro,z diff --git a/proxy/nginx.conf b/proxy/nginx.conf index e519aee..746fbc1 100644 --- a/proxy/nginx.conf +++ b/proxy/nginx.conf @@ -16,6 +16,10 @@ http { server backend-b:80; } + upstream backend_c { + server backend-c:80; + } + server { listen 80; server_name _; @@ -39,6 +43,13 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + location /service/c { + proxy_pass http://backend_c/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + location = /healthz { default_type text/plain; return 200 "ok\n";