How do I log what nginx sends to the proxy with proxy_pass?

Viewed 2665

I have a fan-out nginx config with a bunch of services running on different port.

I'm having a lot of difficulty getting the services to behave as expected when accessed via nginx; they behave as expected when hit locally.

How can I see what URI/URL is being passed to the proxy precisely?

The relevant bit of the nginx config is below:

    location ~ ^/auth/(.*)$ {
            #proxy_set_header Host api.flourishzone.uk/auth/ ;
            proxy_set_header Host $host;
            add_header X-debug-message "URI  ${request_uri}";
            add_header X-debug-message "URI passed thru ${uri}";
            proxy_pass http://127.0.0.1:8080/auth/$1;
    }
0 Answers
Related