Many organizations deploy the Wazuh Dashboard behind an Nginx reverse proxy to simplify TLS termination, centralize authentication, and expose the dashboard through a single public endpoint.
While this architecture is reliable, it also introduces another component that can become a bottleneck when communication between Nginx and the Wazuh Dashboard is interrupted.
One of the most common problems administrators encounter is an upstream timeout.
An upstream timeout occurs when Nginx forwards a request to the Wazuh Dashboard but does not receive a response before the configured timeout expires.
Instead of displaying the requested page, Nginx returns an error such as 504 Gateway Timeout, 502 Bad Gateway, or a connection timeout message.
These errors often appear intermittently during periods of high load but can also persist indefinitely when there is a configuration or networking issue.
For Wazuh deployments, upstream timeout problems affect far more than the web interface.
Since the dashboard communicates extensively with the Wazuh API and the Wazuh Indexer to retrieve alerts, inventory data, agent status, and security events, proxy failures can prevent users from logging in, viewing dashboards, executing searches, or managing agents.
In severe cases, the dashboard may appear completely unavailable even though the underlying Wazuh services remain operational.
According to the official Nginx documentation, upstream timeouts are generally caused by slow upstream applications, network latency, overloaded backend services, or proxy timeout values that are too restrictive.
Throughout this guide, you’ll learn how Wazuh traffic flows through an Nginx reverse proxy, where upstream timeouts occur, how to identify the exact cause using logs and diagnostic tools, and the configuration changes that reliably resolve these errors.
You’ll also learn preventative best practices to ensure stable dashboard performance as your Wazuh deployment grows.
Process of Fixing Nginx Upstream Timeouts
In general, you should follow this process:
- Verify that the Wazuh Dashboard service is running.
- Confirm the dashboard is listening on the expected port.
- Test connectivity between Nginx and the dashboard.
- Review Nginx and Wazuh Dashboard logs for specific errors.
- Validate proxy configuration, headers, and WebSocket support.
- Check Wazuh Indexer health and search performance.
- Optimize timeout values only when backend performance is confirmed.
Understanding How Nginx Proxies Wazuh Dashboard Traffic
Before troubleshooting timeout errors, it’s important to understand how requests travel through a typical Wazuh deployment.
An upstream timeout can occur at several points in the request chain, and identifying the failing component dramatically shortens troubleshooting time.
Typical Wazuh Deployment Architecture
A common production deployment looks similar to the following:
In many environments, Nginx is the only publicly accessible service.
The Wazuh Dashboard listens on an internal interface, while the Wazuh Indexer and Wazuh Manager remain isolated from direct internet access.
This layered architecture improves security but also means every dashboard request depends on multiple backend services responding within acceptable time limits.
Role of Nginx as a Reverse Proxy
Nginx acts as an intermediary between users and the Wazuh Dashboard.
Rather than serving dashboard content itself, it forwards HTTP or HTTPS requests to the backend application.
Its responsibilities typically include:
- SSL/TLS termination
- Load balancing (when multiple dashboard instances exist)
- URL routing
- Request buffering
- Compression
- Access control
- Reverse proxying to the Wazuh Dashboard
Because Nginx sits between clients and Wazuh, any communication delay beyond configured timeout values causes Nginx to terminate the request and return an error.
The official Nginx documentation explains that directives such as proxy_connect_timeout, proxy_read_timeout, and proxy_send_timeout govern how long Nginx waits for upstream responses before closing the connection.
Communication Between Components
Client Browser
The user’s browser sends requests for:
- Dashboard pages
- JavaScript assets
- CSS files
- API requests
- Authentication requests
- Live dashboard updates
Most modern browsers issue many simultaneous requests when loading the Wazuh Dashboard.
Nginx
Nginx receives every browser request and determines where it should be forwarded.
If configured correctly, it:
- Accepts HTTPS connections
- Validates SSL certificates
- Applies proxy rules
- Opens a connection to the Wazuh Dashboard
- Waits for a response
- Returns that response to the browser
Wazuh Dashboard
The dashboard processes requests from Nginx and performs actions such as:
- Authenticating users
- Rendering dashboards
- Executing searches
- Calling the Wazuh REST API
- Querying the Wazuh Indexer
Some operations, particularly complex searches involving large numbers of security events, naturally require more processing time.
Wazuh Indexer
The Wazuh Dashboard depends heavily on the Wazuh Indexer for retrieving indexed security data.
If the indexer responds slowly because of:
- heavy disk I/O,
- insufficient heap memory,
- overloaded CPU,
- large queries,
- or unhealthy cluster status,
the dashboard cannot respond quickly enough to Nginx, resulting in an upstream timeout.
Related Guide: How to Fix a Yellow Cluster Status in Wazuh Indexer
Related Guide: How to Fix circuit_breaking_exception Data Overloads in Wazuh Indexer
Common Proxy Request Flow
A simplified request typically follows this sequence:
- The browser requests a dashboard page.
- Nginx accepts the request.
- Nginx forwards it to the Wazuh Dashboard.
- The dashboard authenticates the user.
- The dashboard queries the Wazuh Indexer.
- The indexer returns matching data.
- The dashboard generates the response.
- Nginx sends the completed response back to the browser.
Every stage introduces a potential delay.
Where Upstream Timeouts Occur
Most timeout errors occur because Nginx waits longer than its configured limits for one of these operations:
- Establishing the initial TCP connection to the dashboard
- Waiting for the dashboard to begin responding
- Waiting for the dashboard to finish generating a response
- Receiving data from the dashboard
- Waiting for long-running Indexer queries to complete
- Waiting for authentication requests to finish
The Nginx creators recommend treating timeout errors as indicators of backend performance or configuration problems rather than simply increasing timeout values.
Raising timeout settings without investigating the underlying cause may temporarily hide the issue while allowing performance problems to worsen over time.
Common Symptoms of Wazuh Nginx Reverse Proxy Timeouts
Upstream timeout problems rarely appear in only one place.
They usually generate a combination of browser errors, Nginx log entries, and application failures that together point toward proxy communication problems.
Recognizing these symptoms early helps determine whether the issue originates in Nginx, the Wazuh Dashboard, the Wazuh Indexer, or the underlying operating system.
504 Gateway Timeout
This is the classic upstream timeout error.
Instead of loading the requested page, Nginx returns:
This indicates that Nginx successfully connected to the upstream server but did not receive a complete response before the configured timeout expired.
The dashboard service may still be running, but it is responding too slowly.
502 Bad Gateway
Sometimes Nginx reports:
Although commonly associated with backend failures, a 502 error can also occur after repeated upstream communication failures or when the backend unexpectedly closes the connection.
See our Fixing Wazuh 502 Bad Gateway: Troubleshooting Guide for more information.
upstream timed out Errors in error.log
One of the strongest indicators appears inside the Nginx error log:
or
These messages indicate that Nginx waited longer than the configured timeout while expecting a response from the Wazuh Dashboard.
According to the official Nginx documentation, these log entries should be correlated with backend application logs to determine whether the upstream application is overloaded or unresponsive.
Connection Refused Messages
Administrators may also encounter messages such as:
Unlike timeout errors, these indicate that the dashboard service is not accepting connections at all.
Possible causes include:
- Dashboard service stopped
- Incorrect upstream IP address
- Incorrect port number
- Firewall blocking connections
- Local socket failures
Dashboard Pages Loading Indefinitely
Users often report that:
- the home page never finishes loading,
- visualizations remain blank,
- dashboards partially render,
- loading indicators never disappear.
This usually means some API requests are succeeding while others are timing out.
API Requests Failing
The browser’s Developer Tools may show numerous failed requests to backend APIs, including:
- HTTP 502
- HTTP 504
- HTTP 499
- Network timeout errors
Since the Wazuh Dashboard depends heavily on asynchronous API calls, even a few failed requests can make the interface appear unusable.
Related Guide: Wazuh API Authentication Failed? Causes and Solutions
Login Page Never Loads
Authentication may fail before users can even access the dashboard.
Common symptoms include:
- Endless loading spinner
- Blank login screen
- Session initialization failures
- Authentication requests timing out
- Browser eventually displaying a timeout page
These issues often occur when the dashboard cannot communicate with the Wazuh API or the Wazuh Indexer quickly enough.
WebSocket Disconnects
Recent versions of the Wazuh Dashboard use persistent connections for various interactive features.
When upstream communication becomes unstable, users may experience:
- Frequent reconnect attempts
- Live updates stopping
- Notifications disappearing
- Unexpected session interruptions
Because WebSockets remain open longer than traditional HTTP requests, improperly configured proxy timeout values can terminate otherwise healthy connections.
Browser Timeout Errors
End users may see browser-specific errors such as:
- ERR_CONNECTION_TIMED_OUT
- ERR_EMPTY_RESPONSE
- ERR_CONNECTION_RESET
- The site took too long to respond
- Network timeout
While these messages originate in the browser, they are often the visible result of upstream timeout failures occurring between Nginx and the Wazuh Dashboard rather than a client-side networking problem.
Common Causes of Upstream Timeout Errors
Upstream timeout errors almost always indicate that Nginx cannot communicate with the Wazuh Dashboard quickly enough to satisfy its configured timeout values.
While increasing the timeout settings may temporarily mask the problem, the real solution is identifying why the upstream server is slow or unreachable.
The following are the most common root causes in Wazuh deployments.
Wazuh Dashboard Service Is Not Running
One of the simplest explanations is that the Wazuh Dashboard service has stopped unexpectedly or failed during startup.
When this happens, Nginx attempts to forward requests to the configured upstream server but receives no response.
Depending on the failure, users may see:
- 502 Bad Gateway
- 504 Gateway Timeout
- Connection refused
- Upstream connection errors
Common reasons the dashboard service stops include:
- Failed upgrades
- Invalid configuration files
- Plugin initialization failures
- Out-of-memory conditions
- Service crashes
- System reboots where the service did not automatically restart
The first troubleshooting step should always be confirming that the dashboard service is healthy before investigating proxy settings.
Related Guide: How to Fix “Wazuh Dashboard Server Is Not Ready Yet” (Step-by-Step)
Incorrect Proxy Pass Configuration
Misconfigured proxy_pass directives are another frequent cause of timeout errors.
Examples include:
- Wrong IP address
- Incorrect port
- Typographical errors
- Missing protocol (
http:// or https://) - Pointing Nginx to an obsolete server after migration
For example:
If the dashboard actually listens on another address or port, Nginx continually waits for responses that never arrive.
The official Nginx documentation recommends carefully validating every upstream server definition and proxy directive whenever backend infrastructure changes.
Firewall Blocking Internal Communication
Even when both Nginx and the Wazuh Dashboard are running, firewall rules may silently block communication.
Potential sources include:
- firewalld
- ufw
- iptables
- nftables
- Cloud security groups
- Host-based endpoint protection
Symptoms often include:
- Connection timed out
- No route to host
- Connection refused
- Random intermittent failures
Remember that firewalls between virtual machines or Kubernetes nodes can introduce communication failures even though both applications appear healthy.
Slow Wazuh Indexer Responses
The dashboard depends heavily on the Wazuh Indexer.
When users open dashboards or perform searches, the dashboard sends multiple requests to retrieve indexed security events.
If the indexer becomes overloaded because of:
- High CPU utilization
- Excessive heap usage
- Slow disks
- Large shard recoveries
- Cluster health problems
- Massive search queries
the dashboard cannot generate responses quickly enough for Nginx.
This often results in intermittent timeout errors during periods of heavy activity.
Elastic, whose search engine architecture underpins OpenSearch, recommends monitoring search latency, heap usage, thread pools, and cluster health when diagnosing slow query performance.
Related Guides:
Insufficient Proxy Timeout Values
Nginx uses several timeout directives that determine how long it waits for upstream servers.
Common examples include:
proxy_connect_timeoutproxy_send_timeoutproxy_read_timeoutsend_timeout
If these values are configured too aggressively, legitimate requests may be terminated before the dashboard finishes processing them.
This is particularly common after:
- Enabling complex visualizations
- Large threat hunting queries
- Cluster upgrades
- Increased log ingestion rates
Increasing timeout values may be appropriate, but only after confirming that backend performance is acceptable.
DNS Resolution Problems
Some deployments configure upstream servers using hostnames instead of IP addresses.
For example:
If DNS resolution fails, Nginx cannot locate the upstream server.
Possible causes include:
- Incorrect
/etc/resolv.conf - Missing DNS records
- Broken internal DNS servers
- Kubernetes DNS failures
- Container networking issues
DNS problems may produce intermittent failures that are difficult to reproduce.
SSL/TLS Handshake Issues
When Nginx communicates with the dashboard over HTTPS, SSL negotiation becomes another potential failure point.
Problems may include:
- Expired certificates
- Self-signed certificates
- Missing intermediate certificates
- TLS version mismatches
- Incorrect cipher suites
Handshake failures often appear as upstream connection failures even though the dashboard itself is functioning correctly.
The official OpenSSL project recommends validating certificate chains and ensuring both endpoints support compatible TLS versions during troubleshooting.
Resource Exhaustion on the Server
Servers experiencing resource pressure frequently exhibit timeout behavior before complete failure.
Important resources to monitor include:
- CPU utilization
- RAM usage
- Swap usage
- Disk I/O
- File descriptors
- Network bandwidth
A heavily loaded server may respond eventually, but not before Nginx reaches its timeout limit.
Administrators should correlate timeout events with system monitoring data to determine whether hardware constraints contribute to the issue.
Reverse Proxy Routing Loops
Configuration mistakes can accidentally create request loops.
For example:
or
Each loop increases latency until requests ultimately time out.
Routing loops commonly occur after:
- Reverse proxy migrations
- Load balancer changes
- Kubernetes ingress modifications
- Incorrect proxy headers
Large Dashboard Queries Timing Out
Threat hunting and forensic investigations frequently generate complex searches.
Examples include:
- Large historical searches
- Multi-index aggregations
- Long time ranges
- Complex filters
- High-cardinality visualizations
These requests can legitimately require significantly longer execution times than standard dashboard operations.
Rather than immediately increasing proxy timeout values, consider optimizing the underlying queries or narrowing search windows to reduce backend processing time.
Verify That the Wazuh Dashboard Service Is Running
Before modifying Nginx configuration, confirm that the upstream service itself is operational.
Many proxy timeout errors ultimately trace back to a dashboard service that has stopped, failed during startup, or is listening on a different interface than expected.
Check Service Status
On most Linux installations, verify the service status with:
A healthy service should report a status similar to:
If the service is inactive, failed, or repeatedly restarting, resolve that issue before continuing with Nginx troubleshooting.
Also look for recent restart attempts or crash messages that may indicate a deeper application problem.
Restart the Service
If the dashboard is unresponsive, restarting the service may restore normal operation.
Then verify that it started successfully:
If the service immediately exits again, avoid repeatedly restarting it. Instead, investigate the startup logs to identify the underlying failure.
Verify Listening Ports
Next, ensure the dashboard is actually listening on its configured port.
On most systems:
or
You should see the dashboard listening on the configured interface.
Typical output resembles:
or
If no process is listening, Nginx has nothing to proxy requests to.
Confirm the Dashboard Is Accessible Locally
Before involving Nginx, verify that the dashboard responds directly.
For example:
or
If HTML or HTTP headers are returned, the dashboard is functioning locally.
If the request hangs or times out, the problem lies with the dashboard rather than Nginx.
Review Startup Logs
The dashboard logs often contain the exact reason startup failed.
Useful messages include:
- Plugin initialization failures
- Configuration syntax errors
- OpenSearch connection failures
- Authentication issues
- Memory allocation failures
- Port binding conflicts
On most systems, recent logs can be viewed with:
You should also review the dashboard’s own log files if available, especially after upgrades or configuration changes.
Related Guides:
Test Connectivity Between Nginx and Wazuh Dashboard
After confirming that the dashboard service is running, verify that Nginx can actually reach it.
Successful communication between these two components is essential for proxy requests to complete without timing out.
Testing connectivity from the Nginx host helps isolate networking issues before making configuration changes.
Using curl
The simplest test is sending an HTTP request directly to the dashboard.
For example:
or, if HTTPS is used:
A successful response confirms that:
- The dashboard is reachable.
- The listening port is correct.
- Basic HTTP communication is functioning.
If the request hangs, returns Connection refused, or times out, investigate the dashboard service and network configuration before modifying Nginx.
Using nc (netcat)
Netcat is useful for verifying that the TCP port is reachable without making an HTTP request.
For example:
Expected output resembles:
A timeout or refused connection indicates that the service is either unavailable or inaccessible from the Nginx host.
Using telnet
Although less common today, Telnet can also verify TCP connectivity.
Example:
A successful connection confirms that the port accepts incoming TCP sessions.
If the connection fails immediately, verify:
- Service status
- Listening interface
- Firewall configuration
- Correct port number
Checking Local Firewall Rules
Local firewall policies may prevent Nginx from communicating with the dashboard even when both services reside on the same server.
Depending on your distribution, inspect the active rules using tools such as:
Look for rules that block traffic to the dashboard’s listening port or restrict communication between local interfaces.
Verifying localhost vs Private IP Connectivity
Many proxy issues stem from mismatched listening addresses.
For example:
- The dashboard listens only on
127.0.0.1, while Nginx proxies to a private IP address. - The dashboard listens on a private IP, while Nginx is configured to use
localhost. - IPv4 and IPv6 addresses are mixed unintentionally.
Test connectivity using the exact address specified in the proxy_pass directive. For example:
If one succeeds and the other fails, the issue is likely an interface binding or routing mismatch rather than an Nginx timeout problem.
Matching the dashboard’s listening address with the proxy_pass target is essential for reliable reverse proxy communication.
Review Your Nginx Reverse Proxy Configuration
Even if the Wazuh Dashboard is healthy, an incorrect Nginx configuration can prevent requests from reaching it successfully.
A single misconfigured directive may lead to intermittent timeouts, broken WebSocket connections, authentication failures, or HTTP 502 and 504 errors.
Before changing timeout values, carefully review your reverse proxy configuration.
Verify proxy_pass
The proxy_pass directive tells Nginx where to forward incoming requests.
A typical configuration looks like:
Verify that:
- The IP address is correct.
- The hostname resolves properly.
- The port matches the Wazuh Dashboard configuration.
- The correct protocol (
http:// or https://) is used. - There are no typographical errors.
Even a minor mistake can cause Nginx to wait for a backend response that never arrives.
The official Nginx documentation recommends verifying upstream server definitions whenever backend infrastructure changes.
Check Upstream Definitions
Many production deployments define upstream servers separately.
Example:
Review each upstream block to ensure:
- Every backend server is reachable.
- Hostnames resolve correctly.
- Ports are accurate.
- Removed servers are no longer referenced.
- Load-balanced servers are healthy.
If one backend server is unavailable, users may experience intermittent timeout errors as Nginx cycles through upstream servers.
Confirm Host Headers
Many web applications, including the Wazuh Dashboard, expect the original Host header to be preserved.
A common configuration includes:
Without the correct host header, the dashboard may:
- Generate incorrect redirects.
- Reject requests.
- Produce authentication issues.
- Fail to build URLs correctly.
Preserving the original host information also simplifies troubleshooting and logging.
Preserve Forwarded Headers
Forwarded headers allow the dashboard to identify the original client connection.
Common directives include:
Missing or incorrect forwarded headers can lead to:
- Authentication problems
- Invalid redirects
- Session issues
- Incorrect client IP logging
- SSL redirect loops
These issues are especially common when Nginx sits behind an external load balancer.
Enable WebSocket Support
The Wazuh Dashboard uses WebSockets for several interactive features.
Without explicit WebSocket support, users may experience:
- Live updates stopping
- Session disconnects
- Dashboard widgets failing
- Endless loading indicators
A typical configuration includes:
These directives allow Nginx to properly proxy upgraded HTTP connections used by WebSockets.
Verify HTTP Version
By default, Nginx may proxy requests using HTTP/1.0.
Many modern applications, including the Wazuh Dashboard, expect HTTP/1.1 for persistent connections and WebSocket upgrades.
Verify the configuration includes:
Without this directive, certain requests may terminate unexpectedly or behave inconsistently.
Validate SSL Configuration
If Nginx communicates with the dashboard over HTTPS, verify the SSL configuration on both sides.
Review:
- Certificate validity
- Certificate chain
- TLS protocol versions
- Cipher suites
- Certificate file paths
- Private key permissions
Handshake failures may appear as generic upstream timeout errors even though the actual issue occurs during TLS negotiation.
The official OpenSSL documentation recommends validating certificate chains whenever secure upstream connections fail.
Increase Nginx Proxy Timeout Settings
After confirming that the Wazuh Dashboard and reverse proxy are correctly configured, you may determine that the existing timeout values are too short for your workload.
Long-running dashboard searches, large visualizations, and high-volume log environments can legitimately require additional processing time.
In these cases, increasing Nginx timeout settings may prevent premature connection termination.
However, timeout adjustments should only be made after ruling out service failures, networking issues, and backend performance bottlenecks.
proxy_connect_timeout
This directive controls how long Nginx waits while establishing a connection to the upstream server.
Example:
If the dashboard is slow to accept new connections because of heavy system load, increasing this value may prevent unnecessary connection failures.
proxy_read_timeout
proxy_read_timeout determines how long Nginx waits for data after successfully connecting to the dashboard.
Example:
This is one of the most important settings for Wazuh deployments because complex searches against the Wazuh Indexer can take significantly longer than ordinary page requests.
When this timeout expires, users typically receive:
- 504 Gateway Timeout
- upstream timed out
- connection timeout
proxy_send_timeout
This directive specifies how long Nginx waits while sending requests to the upstream server.
Example:
Although dashboard requests are usually small, this setting becomes more important when large payloads or uploads are involved.
send_timeout
send_timeout controls how long Nginx waits while transmitting the response back to the client.
Example:
Slow client connections or network interruptions can trigger this timeout even when the dashboard responds normally.
keepalive_timeout
Persistent HTTP connections reduce connection overhead by allowing multiple requests to reuse the same TCP session.
Example:
Proper keepalive values can improve overall dashboard responsiveness while reducing connection setup time.
Avoid setting extremely long values unless they are required for your environment.
When Increasing Timeout Values Is Appropriate
Increasing timeout settings is reasonable when:
- Dashboards execute legitimately long searches.
- Users analyze large historical datasets.
- Security events span multiple indices.
- Infrastructure latency is expected.
- Hardware resources are temporarily constrained.
- High-volume ingestion causes occasional processing delays.
Organizations with large Wazuh deployments often increase proxy_read_timeout after validating that backend services remain healthy and responsive.
Avoid Masking Underlying Performance Issues
Increasing timeout values should not become the default solution.
If the Wazuh Dashboard consistently requires several minutes to respond, investigate the underlying cause instead.
Potential root causes include:
- Slow Wazuh Indexer queries
- Excessive JVM heap pressure
- CPU saturation
- Disk bottlenecks
- Memory exhaustion
- Network latency
- Oversized dashboards
- Cluster health issues
Simply allowing Nginx to wait longer may hide these problems while overall system performance continues to degrade.
The Nginx engineering team recommends treating repeated timeout errors as indicators of backend performance issues rather than relying solely on larger timeout values.
Related Guides:
Inspect Nginx Error Logs
Nginx error logs are one of the most valuable resources for diagnosing upstream timeout problems.
They often identify the exact stage at which communication with the Wazuh Dashboard failed, making it much easier to distinguish between networking issues, configuration mistakes, and backend performance problems.
Whenever possible, review the error logs before making configuration changes.
Location of Nginx Logs
The log location depends on your Linux distribution and installation method.
Common locations include:
and
Some systems managed by systemd may also write messages to the system journal:
Always ensure logging is enabled before beginning troubleshooting.
Reading Upstream Timeout Messages
The most recognizable indicator is an upstream timeout message similar to:
or
These entries indicate that Nginx successfully contacted the dashboard but did not receive a response before the configured timeout expired.
Pay attention to:
- The requested URL
- The upstream server address
- The client IP
- The timestamp
- The HTTP status code
Together, these details help identify which requests consistently fail.
Identifying SSL Errors
TLS negotiation failures often generate log entries such as:
or
These errors may result from:
- Expired certificates
- Invalid certificate chains
- Unsupported TLS versions
- Cipher mismatches
- Incorrect certificate configuration
Although users may only see a generic gateway error, the underlying issue is frequently an unsuccessful SSL handshake.
Detecting Connection Resets
Connection reset errors typically resemble:
or
These messages indicate that the upstream server unexpectedly terminated the TCP connection.
Possible causes include:
- Dashboard crashes
- Process restarts
- Memory exhaustion
- Operating system resource limits
- Application exceptions
Recognizing DNS Resolution Failures
If Nginx cannot resolve the configured upstream hostname, error logs often contain entries similar to:
or
These messages point toward:
- Missing DNS records
- Incorrect resolver configuration
- Internal DNS outages
- Typographical errors in hostnames
Resolving DNS problems often restores proxy functionality immediately.
Correlating Timestamps with Dashboard Logs
One of the most effective troubleshooting techniques is comparing Nginx log timestamps with Wazuh Dashboard logs.
For example:
- Find the exact time a timeout occurred in
error.log. - Locate the corresponding entries in the dashboard logs.
- Check whether the dashboard:
- Received the request.
- Began processing it.
- Encountered an exception.
- Timed out while querying the Wazuh Indexer.
- Compare the same timestamp with Indexer logs and system resource metrics.
Correlating logs across multiple services provides a complete picture of the request lifecycle and helps pinpoint whether the failure originated in Nginx, the Wazuh Dashboard, the Wazuh Indexer, or the underlying operating system.
Related Guides:
Check Wazuh Dashboard Logs
While Nginx logs indicate that an upstream request failed, the Wazuh Dashboard logs often explain why it failed.
Reviewing these logs can reveal startup issues, authentication problems, plugin errors, or communication failures with the Wazuh Indexer that ultimately cause Nginx to return 502 or 504 errors.
When troubleshooting upstream timeouts, always examine the dashboard logs alongside the Nginx error log.
Default Log Locations
The exact log location depends on your operating system and installation method.
Common locations include:
or
On systems managed with systemd, you can also view recent log entries using:
Review logs from the time the timeout occurred rather than only the most recent entries.
Startup Failures
If the dashboard never starts successfully, Nginx cannot establish an upstream connection.
Common startup failures include:
- Invalid configuration files
- Missing environment variables
- Port conflicts
- Permission errors
- Plugin initialization failures
- Failed connections to the Wazuh Indexer
Typical log messages may reference:
- Configuration validation errors
- Fatal exceptions
- Process termination
- Failed service initialization
If the dashboard repeatedly exits immediately after starting, resolve the startup failure before modifying Nginx.
Related Guide: How to Fix “Wazuh Dashboard Server Is Not Ready Yet” (Step-by-Step)
Authentication Errors
Authentication failures between the dashboard and backend services can also contribute to proxy timeout issues.
Look for messages related to:
- Invalid usernames or passwords
- Authentication token failures
- Session expiration
- Authorization failures
- Security plugin errors
If the dashboard continuously retries failed authentication requests, Nginx may eventually exceed its configured timeout limits.
Related Guide: Wazuh API Authentication Failed? Causes and Solutions
Plugin Loading Problems
The Wazuh Dashboard relies on multiple plugins during startup.
Plugin-related failures may include:
- Dependency errors
- Version incompatibilities
- Missing plugins
- Configuration syntax errors
- Plugin initialization exceptions
A partially initialized dashboard may accept connections but fail to process requests correctly, resulting in intermittent upstream timeout errors.
After upgrading Wazuh, verify that all bundled plugins are compatible with the installed dashboard version.
OpenSearch Communication Failures
Most dashboard operations require communication with the Wazuh Indexer (OpenSearch).
Common log messages include:
- Unable to connect to OpenSearch
- Connection timeout
- SSL verification failed
- Authentication failed
- Cluster unavailable
If the dashboard cannot retrieve data from the Indexer, user requests remain pending until Nginx eventually times out.
Pay particular attention to repeated connection retries, as they often indicate an underlying networking or certificate issue.
Related Guides:
Memory-Related Errors
Insufficient memory can significantly impact dashboard responsiveness.
Look for log entries mentioning:
- JavaScript heap exhaustion
- Out-of-memory errors
- Garbage collection pauses
- Process termination
- Memory allocation failures
Although these issues may not directly reference Nginx, they can slow dashboard responses enough to trigger upstream timeout errors.
Monitoring system memory usage alongside dashboard logs helps determine whether resource exhaustion contributes to the problem.
Verify Communication with the Wazuh Indexer
The Wazuh Dashboard depends on the Wazuh Indexer to retrieve alerts, agent information, security events, dashboards, and visualizations.
Even if both Nginx and the dashboard are functioning correctly, slow or failed communication with the Indexer can prevent requests from completing before Nginx reaches its timeout limits.
Verifying Indexer connectivity is therefore a critical part of diagnosing upstream timeout errors.
Test Indexer Availability
First, confirm that the Indexer is reachable from the Wazuh Dashboard server.
A simple test using curl might resemble:
A healthy Indexer typically returns cluster information in JSON format.
If the request hangs, fails to connect, or returns connection errors, investigate:
- Service availability
- Firewall rules
- Listening interfaces
- Network routing
- TLS configuration
Check Indexer Health
A running Indexer is not necessarily a healthy one.
Query the cluster health endpoint:
Pay particular attention to:
- Cluster status
- Number of active nodes
- Unassigned shards
- Pending tasks
- Initialization status
A green cluster generally indicates healthy operation, while yellow or red status may explain slow dashboard responses.
Related Guide: How to Fix a Yellow Cluster Status in Wazuh Indexer
Verify Certificates
If HTTPS is enabled between the dashboard and the Indexer, verify that all certificates are valid.
Check for:
- Correct server certificates
- Matching private keys
- Trusted certificate authorities (CAs)
- Proper file permissions
- Valid certificate chains
Certificate validation failures frequently appear as connection or timeout problems even though the underlying issue is SSL verification.
The official OpenSearch documentation recommends validating every certificate in the trust chain when secure node communication fails.
Authentication Validation
The dashboard must authenticate successfully before accessing Indexer data.
Verify:
- Username
- Password
- Security roles
- Backend roles
- API permissions
Authentication failures may generate repeated retry attempts, increasing response times and contributing to upstream timeout errors.
Review both dashboard logs and Indexer security logs when authentication problems are suspected.
Cluster Health
Poor cluster health directly impacts dashboard responsiveness.
Investigate issues such as:
- Unassigned shards
- Relocating shards
- Failed nodes
- High JVM usage
- Excessive disk utilization
- Cluster recovery operations
A degraded cluster may still process requests, but much more slowly than expected.
Search Latency
Long-running search queries are a common source of upstream timeouts.
Monitor search performance for:
- High query latency
- Slow aggregations
- Large result sets
- Expensive wildcard searches
- High-cardinality aggregations
The OpenSearch Performance Analyzer and cluster statistics APIs can help identify searches that consistently exceed acceptable response times.
Related Guide: How to Fix circuit_breaking_exception Data Overloads in Wazuh Indexer
Node Availability
If your deployment uses multiple Indexer nodes, verify that each node is healthy and participating in the cluster.
Check for:
- Offline nodes
- Network partitions
- Failed master elections
- Disk failures
- Resource exhaustion
Intermittent node failures often lead to inconsistent dashboard performance, making timeout errors difficult to reproduce.
Resolve SSL Certificate and TLS Configuration Problems
SSL and TLS misconfigurations frequently present as upstream timeout or gateway errors because Nginx cannot establish a secure connection with the Wazuh Dashboard or the Wazuh Indexer.
Although the browser may only display a generic 502 Bad Gateway or 504 Gateway Timeout message, the underlying cause is often a failed TLS handshake or certificate validation error.
Carefully validating your SSL configuration can eliminate these communication failures.
Certificate Mismatches
A certificate mismatch occurs when the certificate presented by the server does not match the hostname that clients use to connect.
For example:
- Certificate issued for
dashboard.example.com - Nginx connects to
wazuh.internal.local
Hostname mismatches typically result in failed TLS verification and rejected connections.
Ensure that certificates are issued for the exact hostnames referenced in your Nginx configuration.
Self-Signed Certificates
Many internal Wazuh deployments use self-signed certificates.
While suitable for private environments, they require every communicating service to explicitly trust the issuing certificate authority.
If Nginx or the Wazuh Dashboard does not trust the certificate, SSL negotiation may fail.
When using self-signed certificates:
- Import the appropriate CA certificate.
- Configure trusted certificate paths.
- Avoid disabling certificate verification except during temporary testing.
Incorrect CA Chains
Incomplete or incorrect certificate authority (CA) chains are another common source of SSL failures.
Typical issues include:
- Missing intermediate certificates
- Incorrect root CA
- Wrong certificate bundle
- Outdated CA files
Clients must be able to validate the complete trust chain before establishing secure communication.
The OpenSearch Security documentation recommends verifying the entire certificate chain rather than only the server certificate.
Expired Certificates
Expired certificates can immediately break communication between:
- Nginx and the Wazuh Dashboard
- Wazuh Dashboard and the Wazuh Indexer
- Clients and Nginx
Verify the expiration date of every certificate used throughout your deployment.
Renew certificates before expiration to prevent unexpected outages.
Many organizations automate certificate renewal to reduce operational risk.
TLS Version Compatibility
Older TLS versions may be disabled by modern software, while newer versions may not be supported by legacy components.
Verify that all participating systems support compatible TLS versions.
Examples include:
Avoid enabling deprecated protocols such as SSLv3 or TLS 1.0 unless absolutely required for legacy compatibility.
The OpenSSL project recommends using current TLS versions and disabling obsolete protocols to improve both compatibility and security.
Hostname Verification Failures
Some deployments connect to upstream servers using IP addresses while certificates contain only DNS hostnames.
For example:
Certificate validation may fail because the IP address does not match the certificate’s Subject Alternative Name (SAN).
To resolve this issue:
- Connect using the hostname listed in the certificate whenever possible.
- Include required DNS names and IP addresses in the certificate SAN extension.
- Verify that DNS records resolve correctly before updating the Nginx configuration.
Related Guide: How to Fix Wazuh Certificate Errors
Check Server Resource Utilization
Upstream timeout errors are not always caused by incorrect Nginx settings or network problems.
In many cases, the Wazuh Dashboard becomes slow because the underlying server is running out of resources.
When the dashboard cannot process requests quickly enough, Nginx continues waiting until its timeout threshold is reached.
Monitoring system resources during timeout events helps determine whether performance limitations are contributing to the problem.
CPU Bottlenecks
High CPU utilization can significantly slow Wazuh Dashboard response times.
The dashboard performs several CPU-intensive operations, including:
- Processing user requests
- Rendering visualizations
- Executing security searches
- Handling authentication workflows
- Communicating with the Wazuh Indexer
Check CPU usage with:
or:
Look for:
- Sustained CPU usage above normal operating levels
- Processes consuming excessive CPU
- CPU spikes matching timeout events
Common CPU-related causes include:
- Large dashboard queries
- High alert ingestion rates
- Indexer search pressure
- Too many concurrent users
- Insufficient CPU allocation
If CPU exhaustion consistently occurs during dashboard activity, increasing Nginx timeout values will only delay the failure.
Memory Exhaustion
Memory pressure is one of the most common causes of slow Wazuh Dashboard performance.
When available RAM becomes limited, the operating system may:
- Kill processes
- Increase swap usage
- Slow application response times
- Cause long garbage collection pauses
Check memory usage:
or:
Monitor:
- Available memory
- Cached memory
- Swap consumption
- Memory pressure events
A dashboard that frequently approaches available memory limits may become unresponsive even though the service remains technically running.
Related Guide: How to Tune OpenSearch Heap Size to Stop Wazuh High Memory Crashes
Swap Usage
Swap allows Linux to temporarily move inactive memory pages from RAM to disk.
While useful as a safety mechanism, heavy swap usage causes significant performance degradation because disk access is much slower than RAM.
Check swap activity:
and:
Warning signs include:
- High swap usage
- Frequent swap-in and swap-out activity
- Slow dashboard responses
- Increased disk utilization
If the Wazuh Dashboard or Indexer frequently relies on swap, investigate memory allocation rather than increasing proxy timeout values.
Disk I/O Delays
The Wazuh ecosystem depends heavily on disk performance.
The Wazuh Indexer continuously performs:
- Index writes
- Segment merges
- Search operations
- Log storage operations
Slow storage can delay dashboard queries long enough to trigger Nginx upstream timeouts.
Check disk performance:
Look for:
- High disk utilization
- Large I/O wait percentages
- Slow read/write latency
Common causes include:
- Underpowered virtual disks
- Shared storage contention
- Full disks
- Excessive index growth
Related Guide: How to Configure Wazuh Log Retention
Network Congestion
Network latency between Nginx, the Wazuh Dashboard, and the Wazuh Indexer can create upstream delays.
Potential causes include:
- Saturated network interfaces
- Packet loss
- Incorrect routing
- Virtual network limitations
- Firewall inspection overhead
Monitor network usage:
or:
Check whether network problems occur at the same time as timeout events.
File Descriptor Limits
Linux limits the number of files and network sockets a process can open simultaneously.
A low file descriptor limit can prevent Nginx from handling enough connections.
Check current limits:
Check Nginx usage:
Symptoms include:
- Connection failures
- Random 502 errors
- Dropped client sessions
- Unable to accept new connections
Increase limits when running larger Wazuh environments with many concurrent users.
Process Limits
Linux also restricts the number of processes and threads that applications can create.
Check process limits:
Problems occur when:
- Nginx workers cannot create connections
- Dashboard processes cannot spawn workers
- Indexer threads become exhausted
Review operating system limits if timeout problems appear only under higher traffic loads.
Optimize Nginx Performance for Wazuh Dashboard
A properly tuned Nginx reverse proxy improves dashboard responsiveness and reduces unnecessary connection overhead.
Default Nginx settings are designed for general workloads and may require adjustment for monitoring platforms such as Wazuh, where users frequently perform searches and load data-intensive dashboards.
Enable Keepalive Connections
Keepalive connections allow clients to reuse existing TCP connections instead of creating a new connection for every request.
Example:
Benefits include:
- Reduced TCP handshake overhead
- Faster dashboard loading
- Lower CPU consumption
- Improved responsiveness
Keepalive settings should balance performance with available connection resources.
Configure Worker Processes
Nginx worker processes determine how many processes handle incoming connections.
A common configuration is:
This allows Nginx to automatically create workers based on available CPU cores.
Benefits:
- Better CPU utilization
- Improved concurrency
- More efficient request handling
For dedicated reverse proxy servers, this is usually preferred over manually specifying worker counts.
Tune Worker Connections
Each worker process has a maximum number of connections it can handle.
Example:
The total connection capacity is approximately:
Increase this value when supporting:
- Many simultaneous dashboard users
- Multiple monitored environments
- High API request volumes
Ensure operating system file descriptor limits are also increased accordingly.
Buffer Optimization
Nginx buffers responses before sending them to clients.
Incorrect buffering settings may contribute to slow dashboard behavior.
Common directives include:
Proper buffer sizing can improve handling of larger dashboard responses.
However, excessive buffering consumes additional memory, so settings should match available server resources.
Compression Considerations
Compression can reduce bandwidth usage when transferring dashboard assets.
Example:
Benefits:
- Faster transmission
- Reduced bandwidth usage
- Improved browser loading times
However, compression increases CPU usage.
For systems already experiencing CPU saturation, compression should be evaluated carefully.
Connection Reuse
Reusing upstream connections reduces the overhead of repeatedly establishing connections between Nginx and the Wazuh Dashboard.
Example:
This is especially useful for environments with:
- Many concurrent users
- Frequent dashboard refreshes
- Heavy API usage
Caching Considerations
Caching can improve performance for static resources such as:
- JavaScript files
- CSS files
- Images
However, caching dynamic Wazuh Dashboard content is generally not recommended because dashboards contain frequently changing security data.
Avoid caching:
- Authentication responses
- API responses
- Security event data
- User-specific dashboard information
Incorrect caching can create confusing issues such as stale alerts or outdated dashboard information.
Verify Firewall and Security Policies
Firewall and security policies can prevent Nginx from communicating with the Wazuh Dashboard even when both services appear healthy.
Because these restrictions often silently drop traffic, they may appear as upstream timeout problems rather than obvious connection failures.
Review every security layer between the reverse proxy and backend services.
firewalld
On Red Hat-based distributions, firewalld controls network access.
Check active rules:
Verify that the dashboard port is accessible.
For example:
Only expose required ports and avoid unnecessarily allowing public access.
ufw
Ubuntu systems commonly use UFW.
Check current rules:
Allow required internal communication:
Restricting access to trusted hosts is preferable to globally opening dashboard ports.
iptables
Legacy Linux environments may still use iptables.
Inspect rules:
Look for:
- Dropped packets
- Rejected connections
- Incorrect source restrictions
Packet counters can help determine whether firewall rules are actively blocking requests.
SELinux
SELinux can restrict Nginx from making outbound network connections.
On SELinux-enabled systems, verify the current mode:
If SELinux is enforcing, allow Nginx network access:
Without this permission, Nginx may fail to proxy requests even though network connectivity appears normal.
AppArmor
Ubuntu systems may use AppArmor to restrict application behavior.
Check profiles:
Look for restrictions affecting:
- Nginx
- Wazuh Dashboard
- Related services
AppArmor denials are typically recorded in system logs.
Cloud Security Groups
Cloud environments introduce additional network filtering layers.
Examples include:
- AWS Security Groups
- Azure Network Security Groups
- Google Cloud Firewall Rules
Verify that internal communication is allowed between:
- Nginx server
- Wazuh Dashboard server
- Wazuh Indexer nodes
Common mistakes include allowing public HTTPS access but forgetting internal backend communication.
Reverse Proxy Access Controls
Nginx itself may restrict access through:
allow and deny directives- Authentication modules
- IP filtering
- Rate limiting
- Request size restrictions
Review configurations for rules such as:
or:
Overly restrictive policies can cause legitimate dashboard requests to fail or appear as timeout problems.
A complete firewall and security review should confirm that every component in the request path can communicate without unnecessary restrictions.
Verify Firewall and Security Policies
Firewall and security policies are often overlooked when troubleshooting Wazuh Dashboard upstream timeout errors.
A firewall rule that blocks communication between Nginx and the Wazuh Dashboard may not generate an obvious application error.
Instead, Nginx waits until the connection attempt or response timeout expires, resulting in errors such as 504 Gateway Timeout or upstream timed out.
Review every security layer that can affect communication between the reverse proxy and the dashboard service.
firewalld
On Red Hat-based distributions such as RHEL, CentOS, Rocky Linux, and AlmaLinux, firewalld manages network access rules.
Check the active firewall configuration:
Verify that the Wazuh Dashboard port is accessible from the Nginx server.
Example:
If the dashboard listens on port 5601, confirm that internal communication is allowed:
In production environments, avoid opening the dashboard port globally. Restrict access to only trusted Nginx servers or internal networks.
ufw
Ubuntu systems frequently use UFW (Uncomplicated Firewall) to manage firewall rules.
Check the current status:
Look for rules that allow traffic between Nginx and the Wazuh Dashboard.
A more secure rule restricts access to the reverse proxy host:
If UFW blocks the connection, Nginx may report:
or:
iptables
Some Linux systems still use iptables for packet filtering.
Inspect current rules:
Pay attention to:
- DROP rules
- REJECT rules
- Port restrictions
- Interface restrictions
Packet counters are especially useful because they reveal whether traffic is being blocked.
For example:
indicates that traffic destined for the dashboard port is being blocked.
SELinux
SELinux can prevent Nginx from connecting to upstream services even when network connectivity appears correct.
Check SELinux status:
If the result is:
verify whether Nginx is allowed to make outbound network connections.
Check the current boolean:
If disabled, enable it:
Without this permission, Nginx may fail silently when attempting to proxy requests.
AppArmor
Ubuntu and Debian systems may use AppArmor to restrict application behavior.
Check active profiles:
Review logs for denied actions:
If AppArmor blocks Nginx from accessing the Wazuh Dashboard, adjust the appropriate profile or create a permitted rule.
Cloud Security Groups
Cloud environments introduce additional network controls outside the operating system.
Examples include:
- AWS Security Groups
- Azure Network Security Groups
- Google Cloud Firewall Rules
Verify that the following communication paths are allowed:
Common cloud firewall mistakes include:
- Allowing HTTPS from users but blocking backend communication
- Restricting private IP ranges incorrectly
- Forgetting rules after migrating servers
- Blocking internal DNS traffic
Always validate both inbound and outbound rules.
Reverse Proxy Access Controls
Nginx itself can restrict access through configuration directives.
Review settings such as:
Examples:
or:
Overly restrictive access controls can prevent legitimate users from reaching the dashboard or cause intermittent failures under load.
Test the Complete Reverse Proxy Path
After validating individual components, test the complete request path from the client browser through Nginx to the Wazuh Dashboard.
Testing each layer separately helps identify exactly where communication fails.
The complete path should be:
Validate Direct Dashboard Access
First, bypass Nginx and connect directly to the dashboard.
From the Nginx server:
or:
A successful response confirms:
- Dashboard service is running
- Port is accessible
- TLS is functioning
- Application is responding
If direct access fails, the problem is not Nginx.
Validate Proxied Access
Next, test the public reverse proxy endpoint:
Compare the results against the direct dashboard test.
Possible outcomes:
| Direct Access | Proxy Access | Likely Cause |
|---|
| Works | Fails | Nginx configuration issue |
| Fails | Fails | Dashboard or Indexer issue |
| Slow | Slow | Backend performance issue |
| Works intermittently | Works intermittently | Resource or networking issue |
This comparison quickly narrows the troubleshooting scope.
Browser Developer Tools
Browser developer tools provide visibility into failed dashboard requests.
Open:
Look for:
- Failed API calls
- 502 responses
- 504 responses
- Slow requests
- WebSocket failures
Pay attention to requests that remain pending for a long time.
These often identify whether the problem affects:
- Authentication
- Dashboard loading
- API communication
- Indexer queries
HTTP Response Verification
Use command-line tools to inspect response headers.
Example:
Verify:
- HTTP status code
- Server response
- Redirect behavior
- SSL handling
Expected responses include:
or:
Unexpected responses:
indicate that the proxy path is still failing.
Authentication Testing
Test whether users can successfully authenticate through Nginx.
Verify:
- Login page loads
- Credentials are accepted
- Sessions remain active
- Redirects work correctly
Authentication failures after adding Nginx often indicate:
- Missing forwarded headers
- Incorrect cookies
- SSL termination problems
- Incorrect hostname handling
Related Guide: Fixing Wazuh API SameSite Cookie Errors to Resolve Dashboard Blocks
API Endpoint Validation
The Wazuh Dashboard relies heavily on backend APIs.
Test API availability:
or relevant Wazuh API endpoints configured in your environment.
Confirm:
- Requests return valid responses
- Authentication tokens work
- API requests do not hang
- Responses complete before timeout values expire
If dashboard pages load but API calls fail, the issue is often related to proxy headers, WebSocket settings, or timeout configuration.
Prevent Future Nginx Reverse Proxy Timeout Problems
Once the Wazuh Dashboard is stable behind Nginx, implement monitoring and maintenance practices to prevent future outages.
A proactive approach reduces the chance that minor performance issues become complete dashboard failures.
Monitor Nginx Error Logs
Regularly review Nginx logs for early warning signs.
Monitor for:
upstream timed outconnection refusedconnection reset by peer- SSL handshake failures
- DNS resolution errors
Example:
Repeated timeout messages often appear before users report problems.
Keep Wazuh Components Updated
Maintain compatibility between:
- Wazuh Manager
- Wazuh Dashboard
- Wazuh Indexer
- Nginx
- Operating system packages
Version mismatches may introduce:
- Plugin failures
- API incompatibilities
- Authentication problems
- Performance regressions
Always review upgrade documentation before applying changes.
Monitor Dashboard Response Times
Track how quickly the dashboard responds.
Useful metrics include:
- HTTP response time
- API latency
- Login duration
- Search execution time
- Dashboard loading time
Performance monitoring helps identify gradual degradation before timeout errors occur.
Use Appropriate Proxy Timeout Values
Configure timeout values based on your environment.
Avoid using extremely low defaults when operating a large Wazuh deployment.
Common settings include:
However, timeout values should reflect actual application requirements rather than compensate for unhealthy infrastructure.
Monitor Server Resource Usage
Regularly monitor:
- CPU
- Memory
- Disk utilization
- Network traffic
- File descriptors
Useful tools include:
Resource monitoring allows administrators to identify bottlenecks before they impact dashboard availability.
Related Guide: Why Is Wazuh Using High CPU? Troubleshooting Guide
Regularly Validate SSL Certificates
Expired certificates can immediately break secure communication.
Create a process to monitor:
- Nginx certificates
- Dashboard certificates
- Indexer certificates
- Internal CA certificates
Automated certificate expiration alerts prevent unexpected dashboard outages.
Test Configuration Changes Before Production
Always validate Nginx changes before applying them.
Check syntax:
Example output:
After validation, reload safely:
Testing prevents simple configuration mistakes from causing production outages.
Document Reverse Proxy Configuration
Maintain documentation covering:
- Nginx configuration files
- Upstream addresses
- Timeout values
- SSL certificate locations
- Firewall rules
- Authentication settings
- Change history
Documentation helps administrators quickly troubleshoot future failures and reduces recovery time during incidents.
A well-documented reverse proxy configuration is especially valuable in security monitoring environments where dashboard availability is critical for incident response.
Frequently Asked Questions (FAQ)
Question: What causes an upstream timeout in an Nginx reverse proxy for Wazuh?
An upstream timeout occurs when Nginx forwards a request to the Wazuh Dashboard but does not receive a response within the configured timeout period.
Common causes include:
- Wazuh Dashboard service not running
- Incorrect
proxy_pass configuration - Firewall restrictions between Nginx and the dashboard
- Slow Wazuh Indexer responses
- Insufficient Nginx timeout values
- SSL/TLS handshake failures
- Server resource exhaustion
- DNS resolution problems
- Large dashboard queries taking too long to complete
The correct fix depends on whether the delay occurs between the client and Nginx, Nginx and the Dashboard, or the Dashboard and the Wazuh Indexer.
Related Guide: Wazuh Dashboard Not Loading? Complete Troubleshooting Guide
Question: Why does Wazuh Dashboard return a 504 Gateway Timeout?
A 504 Gateway Timeout means Nginx successfully received the client request but did not receive a response from the upstream Wazuh Dashboard before the configured timeout expired.
Common reasons include:
- Dashboard processing delays
- Slow OpenSearch queries
- High CPU or memory usage
- Network latency
- Proxy timeout values that are too low
A 504 error does not necessarily mean the Wazuh Dashboard service is offline. The dashboard may still be running but unable to respond quickly enough.
Check both Nginx logs and Wazuh Dashboard logs to identify the actual cause.
Question: How do I increase proxy timeout values in Nginx?
Edit your Nginx reverse proxy configuration and adjust timeout directives inside the relevant server or location block.
Example:
After making changes, validate the configuration:
If the syntax check succeeds, reload Nginx:
However, increasing timeout values should not replace investigating backend performance issues.
If requests consistently require several minutes to complete, check Wazuh Dashboard, Indexer performance, and server resources.
Question: How can I tell if the Wazuh Dashboard service is running?
Check the service status:
A healthy service should display:
You can also confirm that the dashboard is listening:
Test local connectivity:
If the service is stopped or not listening, resolve the dashboard issue before troubleshooting Nginx.
Question: Why does Nginx show “upstream timed out while reading response header”?
This message:
means Nginx successfully connected to the Wazuh Dashboard but waited too long for the application to send a response header.
Common causes include:
- Slow dashboard initialization
- Heavy Wazuh Indexer queries
- High server load
- Memory pressure
- Large dashboard visualizations
- Insufficient
proxy_read_timeout values
The important distinction is that the connection succeeded, the problem occurred while waiting for the application response.
Question: Can SSL certificate problems cause upstream timeout errors?
Yes. SSL/TLS problems can appear as upstream timeout errors when Nginx cannot establish or maintain a secure connection with the Wazuh Dashboard or Wazuh Indexer.
Common certificate-related causes include:
- Expired certificates
- Certificate hostname mismatches
- Missing CA certificates
- Invalid certificate chains
- Unsupported TLS versions
Review Nginx error logs for messages such as:
or:
Related Guide: How to Fix Wazuh Certificate Errors
Question: How do I test communication between Nginx and the Wazuh Dashboard?
Test the dashboard directly from the Nginx server.
curl:
netcat:
telnet:
If direct communication succeeds but the reverse proxy fails, the problem is likely inside the Nginx configuration.
If both fail, investigate:
- Dashboard service status
- Firewall rules
- Listening ports
- SSL configuration
Question: Should I use localhost or an IP address in the proxy_pass directive?
Either can work, but the correct choice depends on your deployment architecture.
Example using localhost:
This works when Nginx and the Wazuh Dashboard run on the same server.
Example using a private IP:
This is required when the dashboard runs on a separate machine.
Considerations:
localhost avoids network routing issues.- Private IP addresses allow distributed deployments.
- Hostnames require reliable DNS resolution.
- The address must match the dashboard listening interface.
Always test connectivity using the exact address configured in proxy_pass.
Question: Can a slow Wazuh Indexer cause Dashboard timeouts?
Yes. The Wazuh Dashboard relies heavily on the Wazuh Indexer to retrieve:
- Alerts
- Agent information
- Vulnerability data
- Security events
- Dashboard visualizations
If the Indexer is slow, the Dashboard cannot complete requests quickly enough, causing Nginx to eventually return timeout errors.
Common Indexer problems include:
- High JVM heap usage
- Unhealthy cluster state
- Slow disk performance
- Too many shards
- Expensive search queries
- Node failures
Monitor Indexer health and performance when dashboard timeouts occur.
Question: How do I view Nginx logs when troubleshooting Wazuh reverse proxy issues?
The primary Nginx logs are usually located at:
and:
View recent errors:
Follow logs in real time:
You can also check Nginx service logs:
Look for messages containing:
upstream timed outconnection refusedconnection reset by peerSSL handshake failedhost not found in upstream
Comparing these timestamps with Wazuh Dashboard and Indexer logs is often the fastest way to locate the failure point.
Conclusion
Nginx upstream timeout errors when proxying Wazuh Dashboard traffic are usually caused by communication problems between the reverse proxy, dashboard service, and backend components.
While errors such as 502 Bad Gateway and 504 Gateway Timeout may appear to be Nginx problems, the underlying issue often involves service availability, resource limitations, SSL configuration, firewall rules, or slow Wazuh Indexer responses.
The most effective troubleshooting approach is to follow a structured process:
- Verify that the Wazuh Dashboard service is running.
- Confirm the dashboard is listening on the expected port.
- Test connectivity between Nginx and the dashboard.
- Review Nginx and Wazuh Dashboard logs for specific errors.
- Validate proxy configuration, headers, and WebSocket support.
- Check Wazuh Indexer health and search performance.
- Optimize timeout values only when backend performance is confirmed.
Preventing future reverse proxy failures requires ongoing maintenance.
Regularly monitor Nginx error logs, track dashboard response times, maintain healthy Wazuh components, validate SSL certificates, review firewall policies, and test configuration changes before applying them to production systems.
A properly configured Nginx reverse proxy provides a secure and reliable access layer for the Wazuh Dashboard. With continuous monitoring and proactive optimization, administrators can maintain stable dashboard availability even as their security monitoring environment grows.
Be First to Comment