How to fix nginx throws 400 bad request and invalid number of arguments in proxy_set_header

Posted February 21, 2020 18.8k views

since i added my domain to the server, i have been receiving this error anytime i want to access the my site on a browser with my domain name, it always renders 400 bad request. i decided to check ngnix error.log, i saw invalid number of arguments in proxysetheader.. please how can i fix this error?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @metalcode03,

It seems you have an error with your configuration file. Unless you show it to us, we won’t be able to help you out.

Having said that, you can check this article on how to configure Server Blocks(Vhost configuration files) on Nginx and maybe you’ll be able to determine the root of the problem in your case -


by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.