This commit is contained in:
AlexBa16
2026-06-01 16:23:30 +02:00
parent 930a4ef124
commit 68d44714ac
+10 -4
View File
@@ -8,6 +8,12 @@ http {
sendfile on; sendfile on;
server_tokens off; server_tokens off;
log_format workshop '$remote_addr - $request '
'status=$status upstream=$upstream_addr '
'rt=$request_time urt=$upstream_response_time';
access_log /var/log/nginx/access.log workshop;
upstream backend_a { upstream backend_a {
server backend-a:80; server backend-a:80;
} }
@@ -36,7 +42,7 @@ http {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /service/a { location = /service/a {
proxy_pass http://backend_a/; proxy_pass http://backend_a/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Proto http;
@@ -47,14 +53,14 @@ http {
proxy_pass http://backend_a/; proxy_pass http://backend_a/;
} }
location /service/b { location = /service/b {
proxy_pass http://backend_b/; proxy_pass http://backend_b/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Proto http;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
location /service/c { location = /service/c {
proxy_pass http://backend_c/; proxy_pass http://backend_c/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Proto http;
@@ -66,7 +72,7 @@ http {
return 200 "ok\n"; return 200 "ok\n";
} }
location /internal/status { location = /internal/status {
access_log off; access_log off;
default_type text/plain; default_type text/plain;