diff options
author | Stephen Wong <stephen.kf.wong@gmail.com> | 2018-04-06 23:59:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-04-06 23:59:12 +0000 |
commit | 02922fdb75d386efe1faccaf6ddfdafbf4eee328 (patch) | |
tree | 3fa52ca0196c7e6243200f2f2f6381b4a2428110 /samples/services/nginx/docker/grpc/templates | |
parent | 10de001191d3d938898993f24c127d72c72d5b33 (diff) | |
parent | 2e5e5aca6dadce74b5566ac5e3154cb5886a0c5f (diff) |
Merge "Fix Nginx lb in k8s/istio" into stable/fraser
Diffstat (limited to 'samples/services/nginx/docker/grpc/templates')
-rw-r--r-- | samples/services/nginx/docker/grpc/templates/lb.template | 15 | ||||
-rw-r--r-- | samples/services/nginx/docker/grpc/templates/proxy.template | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/samples/services/nginx/docker/grpc/templates/lb.template b/samples/services/nginx/docker/grpc/templates/lb.template index 4866408..37de1af 100644 --- a/samples/services/nginx/docker/grpc/templates/lb.template +++ b/samples/services/nginx/docker/grpc/templates/lb.template @@ -61,10 +61,20 @@ http { upstream {{ slb_group }} { {%- for item in slb_list %} - server {{ item }}; + server 127.0.0.1:800{{ loop.index }}; {%- endfor %} } + {%- for item in slb_list %} + server { + listen 800{{ loop.index }}; + location / { + proxy_http_version 1.1; + proxy_pass http://{{ item }}; + } + } + {%- endfor %} + server { listen {{ server_port }}; server_name {{ server_name }}; @@ -73,6 +83,9 @@ http { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Real-IP $remote_addr; proxy_pass http://{{ slb_group }}; } diff --git a/samples/services/nginx/docker/grpc/templates/proxy.template b/samples/services/nginx/docker/grpc/templates/proxy.template index 72d611e..e7305b3 100644 --- a/samples/services/nginx/docker/grpc/templates/proxy.template +++ b/samples/services/nginx/docker/grpc/templates/proxy.template @@ -67,6 +67,9 @@ http { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Real-IP $remote_addr; proxy_pass {{ proxy_path }}; post_action @post_ids; @@ -76,6 +79,9 @@ http { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Real-IP $remote_addr; proxy_pass {{ mirror_path }}; } |