Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query on Content-Length response header #1

Open
SudharsanN opened this issue Dec 9, 2019 · 2 comments
Open

Query on Content-Length response header #1

SudharsanN opened this issue Dec 9, 2019 · 2 comments

Comments

@SudharsanN
Copy link

We are using your repo to troubleshoot a production issue wherein we were receiving 'Duplicate Content-Length' error while making a call to an API. So, we introduced a proxy between the application and the API. Ever since we introduced the proxy the issue disappeared. We are pretty sure that the API team didn't fix their code as they are waiting on us to capture the error scenario.

My queries here are as below.

  1. Does OpenResty or nginx or luajson that we are using is removing the duplicate content-length header if the values are same ?
  2. If the above is true, can you please point me to the docs. Also, is there a way for us to log the headers before it gets removed ?
  3. Are we inadvertently removing it as part of the lua script ?

I have attached the docker file, nginx.conf and lua script as a zip file.
Please clarify as we are lost on what exactly is happening here.
Archive.zip

@tarunlalwani
Copy link
Owner

You should not test it using this way. Instead put a socat forwarding to see the raw request and raw responses. See the below article for more details

https://tarunlalwani.com/post/how-to-debug-nginx-reverse-proxy-issues-php-fpm-gunicorn-uwsgi/

@SudharsanN
Copy link
Author

SudharsanN commented Dec 9, 2019

Thanks for the quick response. Can you let me know what is causing the duplicate content length to be removed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants