From b41a9cc3c9a9d194f48bf1ccc39e2a3cced23cfe Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 14 Aug 2023 13:38:13 -0700 Subject: [PATCH] fixing proxy for http --- nginx.conf | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index daed5e5..41367bd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -14,12 +14,26 @@ http { server { listen 5000; - proxy_pass localhost:5001; + + location / { + proxy_pass http://localhost:5001; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } } server { listen 80; - proxy_pass localhost:33360; # TODO: change to NodePort of helloworld within kubernetes + + location / { + proxy_pass http://localhost:33360; # TODO: change to NodePort of helloworld within kubernetes + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } } }