NetSendo Logo
Platform Updates

NetSendo v2.2.1: Fix for 502 Errors in the Email Editor

NetSendo Team6 min read
NetSendo v2.2.1: Fix for 502 Errors in the Email Editor

You bookmark the email editor so you can get back to a campaign quickly. Or you press F5 halfway through a draft. Instead of your message, you get a plain 502 Bad Gateway page. Yet when you click your way to the same screen from the dashboard, it loads without any trouble. That kind of bug makes people lose trust in a platform, especially when a campaign has to go out on time.

NetSendo v2.2.1 (released 2026-11-07) fixes this. The cause was a single HTTP response header that had grown too big. This article explains what went wrong, how it was fixed, and what you need to do on a self-hosted install. For most installs the answer is to pull the new image.

TL;DR: In NetSendo v2.2.1, opening /messages/create or /messages/{id}/edit directly (from a link, a refresh or a bookmark) no longer returns 502 Bad Gateway. The Laravel Link preload header now lists at most 8 assets, so response headers stay at about 2 KB. The fix ships in the Docker image, and you don't need to change your nginx configuration. New installs also get larger FastCGI header buffers in docker/nginx/default.conf.

🚀 What's New in v2.2.1

🛠️

No More 502 on Direct Loads

The email editor opens reliably from links, bookmarks and refreshes.

📦

Smaller Response Headers

The Link header is capped at 8 assets, which keeps headers at about 2 KB.

⚡

Same Loading Speed

Every chunk is still preloaded through <link rel="modulepreload"> tags in the HTML.

🧱

Extra nginx Headroom

New installs get larger FastCGI buffers in case headers grow again.

The Symptom: It Works by Click, Fails on Reload

NetSendo's panel is a single-page-style application. When you click a link inside the dashboard, the frontend fetches only the data for the next screen. The full HTML document isn't requested again. A full page load is different: typing the URL, refreshing, opening a bookmark or following a link from an email all ask the server for the whole page, headers included.

That's why the bug only appeared on full loads of the email editor, at /messages/create and /messages/{id}/edit.

The Root Cause: A Header That Got Too Big

Laravel has a middleware called AddLinkHeadersForPreloadedAssets. It adds a Link HTTP header that tells the browser to start downloading the page's JavaScript and CSS early. The middleware put every chunk of the page into that one header.

The email editor is one of the richest screens in NetSendo, with about 27 JavaScript and CSS chunks. Add absolute asset URLs and the session cookies, and the response headers grew past nginx's default 4 KB FastCGI buffer. When the headers from PHP-FPM don't fit in that buffer, nginx drops the response and returns 502 Bad Gateway.

ℹ️ Analogy: Think of the response headers as the label on a parcel and nginx's FastCGI buffer as the label slot on the conveyor belt. The parcel itself (your page) was fine. The label just got so long that it didn't fit in the slot, so the parcel was rejected before anyone opened it.

The Fix: Cap the Preload Header at 8 Assets

NetSendo now registers the middleware with a limit, in bootstrap/app.php:

use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;

// The Link header now lists at most 8 preloaded assets
AddLinkHeadersForPreloadedAssets::using(8)

This keeps response headers at about 2 KB on every page, well inside nginx's default buffer.

Nothing loads later than before. The page HTML still has a <link rel="modulepreload"> tag for every chunk, so the browser still knows about all assets up front. The header simply no longer repeats the full list.

💡 Good to know: This fix ships inside the NetSendo image. You don't need to change your nginx configuration to get it. Pulling v2.2.1 is enough.

Extra Headroom: Larger FastCGI Buffers

As a second layer of protection, the bundled docker/nginx/default.conf now gives PHP responses larger header buffers:

fastcgi_buffer_size 32k;
fastcgi_buffers 16 16k;

New installs get this headroom automatically. Existing installs keep their current copy of this file until they replace it. That's safe, because the header cap already fixes the 502 on its own.

💼 Benefits & Use Cases

  • ✅ Bookmarks and shared links to drafts open reliably
  • ✅ Refreshing the editor no longer breaks your workflow
  • ✅ No server changes needed on existing installs
  • ✅ Page performance stays the same thanks to modulepreload tags
  • ✅ Extra protection against oversized headers on new installs
🛒

E-commerce: Last-Minute Campaign Edits

A flash sale starts in an hour and you need to change the discount code in your abandoned-cart or promo email. You open the bookmarked editor URL and it loads straight away:

  • Make quick edits to post-purchase sequences straight from a bookmark
  • Refresh after an asset change and see the result
  • Avoid losing time to a confusing gateway error during peak sales
🚀

SaaS: Team Review of Onboarding Emails

Product, marketing and support often review onboarding and churn-prevention emails together. Now you can:

  • Paste a direct /messages/{id}/edit link into Slack or a ticket
  • Let reviewers open it in a new tab without workarounds
  • Speed up approval cycles for lifecycle campaigns
🏢

Agencies: Managing Many Client Campaigns

Agencies often work with dozens of open tabs across client accounts. With v2.2.1:

  • Restored browser sessions reopen editor tabs correctly
  • Client-facing links to drafts work on the first click
  • Fewer "the editor is broken" support tickets

🧭 Step-by-Step: Upgrading to v2.2.1

  1. Back Up First

    Before any upgrade, back up your database and any configuration files you've customized, including your nginx config if you changed it.

  2. Pull the New Image

    From the directory that holds your docker-compose.yml, pull the latest image and recreate the containers:

    docker compose pull
    docker compose up -d
  3. Test a Direct Load of the Editor

    Log in, open an existing message, then press F5 on /messages/{id}/edit. Also open /messages/create in a new tab. Both should load normally.

  4. Optional: Inspect the Headers

    Open your browser's DevTools (Network tab), reload the editor and click the document request. The Link response header should list no more than 8 assets. In the Elements panel you'll still see <link rel="modulepreload"> tags for every chunk.

  5. Optional: Adopt the New nginx Buffers

    If you want the extra headroom on an existing install, compare your docker/nginx/default.conf with the version in the repository and add the fastcgi_buffer_size and fastcgi_buffers directives to your PHP location block. Then restart the nginx container.

⚠️ Common pitfall: If you replace default.conf with the new upstream version, copy over your own changes first (custom domains, SSL settings, upload limits). Merging only the two buffer directives is usually the safest option.
ℹ️ Still seeing 502? If you run another reverse proxy in front of NetSendo (for example a host-level nginx), check its error log for messages such as "upstream sent too big header". That proxy may have its own buffer limits.

🎯 Expert Tips

1
Read the nginx Error Log First

When a 502 appears, nginx's error log usually names the cause. "Upstream sent too big header" points straight to buffer size, not to a crashed PHP process.

2
Always Test Full Page Loads

After an upgrade, don't just click around the panel. Refresh the heavier screens, like the email editor, too. Navigation inside the app can hide problems that only show up on full requests.

3
Keep Cookies Lean

Cookies count toward header size. If you add tracking or custom cookies on the panel's domain, keep them small. They add to every response that sets them.

4
Version-Control Your Config Overrides

Keep your customized nginx and Docker files in Git. When upstream defaults improve, as they did here, a diff shows you exactly what to merge.

5
Pin Versions in Production

Pin your image to an explicit version tag and upgrade on purpose. That way you control when fixes like v2.2.1 reach your users, and you can roll back if you need to.

✅ Conclusion

NetSendo v2.2.1 is a small, focused release that fixes a frustrating problem: the email editor returned 502 Bad Gateway when opened directly. The cause was an oversized Link preload header that went past nginx's default 4 KB FastCGI buffer. Capping it at 8 assets fixes the problem without slowing anything down, and new installs also get larger FastCGI buffers.

Because you host NetSendo yourself, you own your data and your infrastructure. Releases like this one come with a clear explanation, so you know exactly what changed on your servers.

Ready to Upgrade?

Pull v2.2.1 and get a reliable email editor today:

Check out our integrations, and if NetSendo helps your business, please star us on GitHub. Full release notes: v2.2.1 on GitHub.

#bugfix#nginx#laravel#email-editor#docker#self-hosted#performance
Share