chore(nginx): precedence x-forward-for ip for geo location tagging

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2022-02-15 18:19:54 +01:00
parent 9d7a070822
commit f2cfd37a37
2 changed files with 28 additions and 4 deletions

View file

@ -13,7 +13,7 @@ data:
}
location ~ ^/(mobs|sessions-assets|frontend|static|sourcemaps|ios-images)/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $origin_forwarded_ip;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
@ -38,7 +38,7 @@ data:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $origin_forwarded_ip;
proxy_set_header X-Forwarded-Host $real_ip;
proxy_set_header X-Real-IP $real_ip;
proxy_set_header Host $host;
@ -71,7 +71,7 @@ data:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $origin_forwarded_ip;
proxy_pass http://utilities-openreplay.app.svc.cluster.local:9000;
}
location /ws-assist/ {
@ -80,7 +80,7 @@ data:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $origin_forwarded_ip;
proxy_set_header X-Real-IP $real_ip;
proxy_pass http://utilities-openreplay.app.svc.cluster.local:9001;
}
@ -151,6 +151,10 @@ data:
default $http_x_forwarded_proto;
'' $scheme;
}
map $http_x_forwarded_for $origin_forwarded_ip {
default $http_x_forwarded_for;
'' $remote_addr;
}
# Default server for helath check
server {
listen 80 default_server;

View file

@ -84,3 +84,23 @@ nodeSelector: {}
tolerations: []
affinity: {}
healthProbes:
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5