NGINX® Troubleshooting

Last modified: 2025 February 10


Overview

This document covers troubleshooting for common problems with NGINX® with reverse proxy.

Could not build proxy_headers hash

You may receive an error that resembles the following message:

nginx: [emerg] could not build proxy_headers_hash, you should increase proxy_headers_hash_bucket_size

If you receive this error message, one of your .conf files contains a proxy_set_header directive that sets a very long header name. To correct this error, add the following directive to the .conf file that contains the long proxy_set_header directive, where number represents a header length:

proxy_headers_hash_bucket_size number;

You must add this directive immediately before the long proxy_set_header directive.

NGINX will not restart

If you used the nginx command to start NGINX, then the /usr/local/cpanel/scripts/restartsrv_nginx and systemctl restart nginx.service commands will not work. To correct this, perform the following steps:

  1. Stop the service with the /usr/sbin/nginx -s stop command.

  2. Restart NGINX with one of the following commands:

    • /usr/local/cpanel/scripts/restartsrv_nginx start
    • systemctl start nginx.service
    • /etc/init.d/nginx start