Good day! We have a nginx-based proxy with next config:
server {
server_name proxy;
listen 80;
underscores_in_headers on;
access_log /var/log/nginx/access.log bodylog;
location / {
proxy_pass http://X.X.X.X:Y;
}
}
Backend is an application with first login page access to search after it. So the problem is:
When we tune proxy to IP address of backend (proxy_pass http://X.X.X.X:Y) we get that all requests in browser after login in start page go through nginx proxy-server and we can log them to access.log.
But if we want to use here https://address.com for the same application like that
location / {
proxy_pass https://address.com;
resolver 127.0.0.11;
}
we got that only first load of login page goes through nginx proxy, but all other actions there (login itself, search after it, etc.) go right on domain https://address.com (not through proxy-server), so cannot be logged in nginx-proxy access.log file, but we need this!
Is there anyway to change this behavior like with proxy_pass to IP?
Additional info: Application deployed in kube cluster, so when I try to reach it to IP requests go to kube-service for app with type LB and then to app. When hen I try to reach it to DNS name with https request go to nginx-ingress-controller in cluster, then to kube-service for app and then to app