How to Fix the "421 Misdirected Request" Error (Nginx, Apache, Plesk)
All dispatches
News2025-07-1710 min read

How to Fix the "421 Misdirected Request" Error (Nginx, Apache, Plesk)

Sam McNeill
Sam McNeill
Commercial Consultant · Black Sheep Support
Share this dispatch

Woke up this morning to find your website suddenly offline? If you are seeing a "421 Misdirected Request" error, you are in the right place. This issue has recently affected a significant number of servers globally, particularly those using Nginx as a reverse proxy in front of Apache. This is a very common setup, often found with Plesk on Ubuntu environments. The problem typically stems from a recent security update to Apache that altered how it processes SSL/TLS connections. This guide provides clear, actionable methods to resolve the error and restore your site's availability.

What the "421 Misdirected Request" Error Actually Means

In plain terms, the "421 Misdirected Request" error indicates a failure in the SSL/TLS handshake process between your web server components. When a user's browser attempts to establish a secure connection to your website, the request first reaches Nginx, which is often configured as a reverse proxy. Nginx's role is to forward this request to the backend web server, typically Apache, which then serves the actual content.

The issue arises because a recent Apache update (specifically version 2.4.58-1ubuntu8.6 or similar patched versions) introduced stricter security requirements for SSL/TLS connections. Apache now more rigorously checks for the Server Name Indication (SNI) extension within the SSL handshake. SNI is a crucial technology that allows a server to host multiple SSL-secured websites on a single IP address by indicating which hostname the client is trying to reach. Previously, Nginx might not have explicitly forwarded this SNI information to Apache. With the updated Apache, if the SNI information is absent or incorrectly passed, Apache rejects the connection, resulting in the "421" error code. Essentially, Apache is saying, "I don't know which site this secure request is for, so I'm not serving it." The fix involves instructing Nginx to correctly pass this necessary SNI information to Apache.

Why it Matters for UK SMEs

For a UK SME, a "421 Misdirected Request" error is not merely a technical glitch; it represents an immediate and tangible threat to business operations and reputation. Your website is often your primary shop window, communication channel, and sometimes your direct sales platform. When it goes offline, the commercial impact is instant.

Firstly, there's the direct loss of revenue. Every minute your site is down, potential customers cannot browse products, make purchases, or access services. This translates directly into missed sales and opportunities. Beyond immediate financial losses, sustained downtime can significantly damage your brand's reputation. In a competitive market, customers expect constant availability. A website that is frequently inaccessible can erode trust, leading customers to seek more reliable alternatives.

From a compliance perspective, the implications are also noteworthy. While this specific error isn't a direct data breach, it concerns the secure delivery of your website via SSL/TLS. Maintaining correctly configured and operational SSL certificates is a fundamental requirement for securing data in transit. This aligns directly with principles of the UK GDPR, particularly Article 32, which mandates appropriate technical and organisational measures to ensure a level of security appropriate to the risk. A broken SSL handshake, even if immediately fixable, indicates a potential vulnerability or misconfiguration in your secure setup.

Furthermore, organisations aiming for certifications like Cyber Essentials, which is increasingly important for UK government contracts and supply chains, must demonstrate robust secure configuration practices. An issue like the "421 Misdirected Request" highlights a server configuration problem that, if left unaddressed or if indicative of broader neglect, could impact such assessments. The National Cyber Security Centre (NCSC) consistently advises on the importance of secure system configurations to mitigate common cyber threats. Frankly, an inaccessible website due to a configuration error is not just an inconvenience; it is a business risk that must be addressed promptly.

How to Fix the "421 Misdirected Request" Error, a Practical Walkthrough

Resolving this error involves making specific configuration changes to your Nginx setup to ensure it correctly forwards SNI information to Apache. Before you proceed with any of the methods below, it is absolutely critical to perform a full server backup. Configuration file edits, if done incorrectly, can lead to further downtime or introduce new issues. A backup ensures you can revert to a known working state if something goes awry. While these methods are well-documented solutions for this specific problem, every server environment can have unique configurations, so proceed with caution.

Precaution: Backup Your Server

Before making any changes, ensure you have a recent, full server backup. This cannot be overstated. Should an unforeseen issue occur, a backup is your primary defence against extended downtime. If you're unsure how to perform a full server backup, consult your hosting provider's documentation or contact a qualified IT professional.

Method 1: The Plesk GUI (Recommended for Plesk Users)

This is the safest and most straightforward method if your server is managed by Plesk, as it avoids direct command-line interaction.

  1. Log in to your Plesk panel. Access your Plesk administration interface using your credentials.
  2. Navigate to Tools & Settings. You'll typically find this in the left-hand menu.
  3. Access Apache & Nginx Settings. Under the "General Settings" group, click on "Apache & Nginx Settings."
  4. Add Nginx Directives. Scroll down the page until you find the text box labelled "Additional Nginx directives."
  5. Paste the Directives. Insert the following two lines into that box:
    proxy_ssl_server_name on;
    proxy_ssl_name $host;
    
  6. Apply and Confirm. Click "Apply" or "OK" to save the changes. Plesk will then attempt to restart Nginx automatically.

After applying, clear your browser cache and try accessing your website. If the error persists, it's worth checking the server logs for more specific errors.

Method 2: The One-Line Command (Fastest for CLI Users)

This method is for experienced users who are comfortable on the command line and require the quickest possible fix. It creates a new Nginx configuration file and restarts the service in one go.

  1. Connect to your server via SSH. Use an SSH client (like PuTTY on Windows or the terminal on Linux/macOS) to connect to your server with appropriate credentials, typically as root or a user with sudo privileges.
  2. Execute the Command. Run the following single command:
    echo -e "proxy_ssl_server_name on;\nproxy_ssl_name \$host;" > /etc/nginx/conf.d/fixssl.conf && service nginx restart
    
    • echo -e "...": This command prints the Nginx directives. The \n creates a new line.
    • > /etc/nginx/conf.d/fixssl.conf: This redirects the output of the echo command into a new configuration file named fixssl.conf within the /etc/nginx/conf.d/ directory. Nginx automatically includes files from this directory.
    • && service nginx restart: The && ensures that nginx restart only runs if the file creation was successful. This command restarts the Nginx service, applying the new configuration.

Verify your website's accessibility after the command completes.

Method 3: Manual File Creation (The Cautious CLI Approach)

This method achieves the same result as Method 2 but allows you to manually create and edit the file, which some users prefer for clarity or to review contents before saving.

  1. Connect to your server via SSH. As with Method 2, establish an SSH connection.
  2. Create and Open a New Configuration File. Use a text editor like nano or vi to create and open a new configuration file. We recommend nano for its user-friendliness:
    sudo nano /etc/nginx/conf.d/fixssl.conf
    
    If you don't have sudo privileges, you might need to execute this as the root user or use su.
  3. Add the Nginx Directives. Inside the nano editor, paste the following two lines:
    proxy_ssl_server_name on;
    proxy_ssl_name $host;
    
  4. Save and Exit.
    • In nano, press Ctrl+X.
    • When prompted to save, press Y (for Yes).
    • When prompted for the filename, press Enter to confirm /etc/nginx/conf.d/fixssl.conf.
  5. Test Nginx Configuration (Optional but Recommended). Before restarting, you can test your Nginx configuration for syntax errors:
    sudo nginx -t
    
    If it reports syntax is ok and test is successful, you can proceed. If not, review your edits carefully.
  6. Restart Nginx. Apply the new configuration by restarting the Nginx service:
    sudo service nginx restart
    
    Or, if you prefer:
    sudo systemctl restart nginx
    

Post-Fix Verification

After applying any of these methods, clear your browser's cache and cookies, then attempt to access your website. It is also advisable to use an online SSL checker tool to confirm that your SSL certificate is correctly installed and configured, and that all intermediary certificates are present. This provides an independent verification that the secure connection is now properly established.

From our service desk data, misconfigured reverse proxies are a frequent cause of unexpected downtime for UK SMEs. For instance, when we onboarded a 45-user London-based architecture practice last quarter, their primary client portal was intermittently inaccessible due to an Nginx configuration that hadn't been updated to correctly handle SNI forwarding, causing issues that presented similarly to this 421 error. Our first step was to review their proxy configurations and implement the necessary directives to ensure stable, secure access.

Common Mistakes We See

Even with clear instructions, certain missteps are common when attempting these fixes:

  1. Skipping the Backup: This is the most critical mistake. Without a backup, a simple typo can render your server unbootable or your website completely inaccessible, leading to significantly longer recovery times.
  2. Incorrectly Pasting Directives: Typos, missing semicolons, or incorrect casing within the Nginx configuration files can lead to syntax errors, preventing Nginx from starting.
  3. Not Restarting Nginx: Configuration changes only take effect after the Nginx service has been successfully restarted. Forgetting this step means the fix won't apply.
  4. Ignoring Server Logs: If the website remains down, failing to check Nginx or Apache error logs means missing crucial diagnostic information that could point to a different underlying issue.
  5. Assuming Universal Applicability: While these methods address the specific "421 Misdirected Request" error, assuming they will fix any website issue without understanding the root cause is a common pitfall.

Key Takeaways

  • The "421 Misdirected Request" error indicates an SSL handshake failure between Nginx and an updated Apache backend.
  • It is caused by Apache's stricter SNI requirements and Nginx not forwarding this information correctly.
  • Fixes involve adding proxy_ssl_server_name on; and proxy_ssl_name $host; directives to your Nginx configuration.
  • Always perform a full server backup before making configuration changes.
  • Confirm the fix by clearing browser cache and checking your website.

When to Call in Help

While the methods outlined provide a direct solution, server management and troubleshooting complex web infrastructure issues are not trivial. If you are uncomfortable with command-line interfaces, lack confidence in your server administration skills, or simply do not have the time to dedicate to these technical tasks, it is often more efficient and less risky to engage professional assistance. An experienced IT partner can quickly diagnose and resolve such issues, ensuring minimal downtime and preventing potential follow-on problems, allowing you to focus on running your business. Frankly, your time is better spent on your core business.

To take the next step

Book a Discovery Call

Back to all dispatchesEnd of Intelligence · BSS Digital Dispatch
Monthly IT briefing

The three things worth knowing this month

One short email a month: what broke, what got patched, and what we would change in a small business this week. No sales pitch, unsubscribe in one click.

We only use your email for the briefing. See our privacy policy.