My website is down when BitNinja is running (Error 502 /504)

You are here:
Estimated reading time: 1 min
If you see an error on your screen with a 5xx error, the issue might be solved differently based on your configuration or setup.

First, we need to check what kind of error code you see.

Error 502

If you see this screen when you try to access a domain that is behind CloudFlare while BitNinja is running with the WAF module enabled and the Trusted proxy module enabled.

  1. Issue bitninjacli --module=SslTerminating --regenerate
  2. Wait for a minute to make sure the command went trough
  3. Run bitninjacli --module=SslTerminating --reload

Then all domains that are behind Cloudflare should be reachable from now.

504 Gateway Time-out

If you see a time-out error 504 from Nginx, like in this screenshot, we need to increase the timeout threshold. We have to increase the values of the “Proxy read timeout” and “HAProxy timeout”.

How to change the value of Proxy read timeout?

  1. Open the Configuration menu on your BitNinja dashboard.
  2. Select the setting level on the left side. (server-level, server group-level, account-level)
  3. Select the WAF 2.0 module on the left side
  4. Scroll down and select the “Advanced settings” menu at the bottom.
  5. Change the “Proxy read timeout” value to 300
  6. Click on the “Apply” button at the top of the screen

How to change the value of HAProxy timeout?

  1. Open the Configuration menu on your BitNinja dashboard.
  2. Select the setting level on the left side. (server-level, server group-level, account-level)
  3. Select the Advanced module on the left side
  4. Scroll down and select the “Protection on HTTPS” menu at the bottom.
  5. Under “Set up HAProxy timeout in seconds” you have to click the “+Add new” button and type in the configuration’s name and the value.
    For example: connect 500s then press “Add”
    Of course, the values can be higher according to your preference. We suggest adjusting the values of the other configurations, such as client and server, as well.
  6. Don’t forget to click on the “Apply” button at the top of the screen

    Once you have configured all the options mentioned earlier, the end result should resemble this:
If You experience any other errors please don’t hesitate to contact us via Chat from the Dashboard or by sending an email to info@bitninja.io.
You can also send us a ticket here.

Was this article helpful?
It was not helpful
Views: 1734