My website is currently using CloudFlare reverse proxy. In my nameservers I have defined DNS provided by CloudFlare. I am having some issue with CloudFlare so want to test it by removing reverse proxy. If I write my server IP in nameservers, will site sill work?


I am getting Error 502 Bad Gateway from CloudFlare when trying to add product in shopping cart. I am using WordPress with WooCommerce. This is happening for all products except the one which I added last time a couple of days ago. I am able to add this product in cart but no other product. Site is hosted on VPS and nothing has been changed on it.

  • 1
    No, you'll need alternate name servers. Most registrars provide name servers no charge. CloudFlare is quite reliable and runs millions of sites DNS and CDN, but it could be misconfiguration. Perhaps you should ask another question describing your problem, rather than telling us the proposed solution and asking if it will work.
    – Tim
    Sep 1, 2020 at 7:50
  • I have described my problem above. Sep 1, 2020 at 7:55
  • Try turning caching off and just use CloudFlare as DNS. To do this, in your CloudFlare DNS screen change the orange cloud to a gray cloud (from memory). If that fixes it you might need to look at your page rules.
    – Tim
    Sep 1, 2020 at 8:18
  • Found and fixed the issue. It was related to nginx. Sep 1, 2020 at 8:21
  • Suggest that to help others in the future you provide a more full explanation of how you solved it below, ideally with the relevant parts of your Nginx configuration.
    – Tim
    Sep 1, 2020 at 8:22

1 Answer 1


I am using nginx with PHPFPM and error was related to memory/cache as this VPS has only 1GB of RAM.

First I looked into nginx logs:
sudo tail /var/log/nginx/error.log -n 10

And found error:
upstream sent too big header while reading response header from upstream

So I added following lines in /etc/nginx/nginx.conf which fixed the issue

fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
  • Thanks for answering your question :) You can come back in 24 hours and accept the answer, that way the question is marked as solved.
    – Tim
    Sep 1, 2020 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.