How to host a Wix export on Nginx

Short answer

To host a Wix export on Nginx, copy the unzipped folder to your web root, add a server block with try_files and an internal 404 page, and set security headers with the always flag. Wix says standard sites cannot be hosted elsewhere, so the copy is a saved render. Replace Wix backend features.

Last reviewed

Key facts

  • Wix’s help says standard Wix sites cannot be exported to another host.
  • add_header without always only applies to successful and redirect responses.
  • A location marked internal can only be reached through an internal redirect such as error_page.
  • Headers set in a location replace those inherited from the server block.

What a Wix export brings to Nginx

WebExport saves the rendered pages of a Wix site together with the scripts, fonts and images, and rewrites the paths to local files. Nginx serves them directly. As the pages are drawn by JavaScript, a missing script file shows up as a blank page, so load the site with the cache disabled before you switch the domain.

Wix sites usually carry a mix of pages, a blog and a handful of large images. Caching images for a week and keeping pages uncached gives visitors fast repeat views and lets a re-export reach them quickly. The configuration below does that and shows how the header inheritance rule works.

Copy the files and add a server block

  1. Copy the unzipped folder to the web root on your server, for example /var/www/exported-site.
  2. Add a server block that points root at that folder and lists index.html as the index file.
  3. Check the syntax, then reload Nginx without dropping connections.
  4. Request a certificate for the domain once DNS points at the server.
terminal
rsync -av --delete exported-site/ user@server:/var/www/exported-site/
sudo nginx -t && sudo systemctl reload nginx

Redirects, headers and 404s on Nginx

Nginx keeps everything in its own config files. Use return 301 for a single move and a map block for a table of old and new paths. error_page 404 /404.html picks the not-found file, and try_files decides how URLs map to files. An add_header directive set inside a location block replaces the ones inherited from the server level, so repeat the headers you still want there. Nginx ignores .htaccess files, which only Apache reads.

This server block sets two security headers on every response, caches images and fonts for a week and serves a hidden 404 page.

/etc/nginx/conf.d/exported-site.conf
server {
    listen 80;
    server_name example.com;
    root /var/www/exported-site;
    index index.html;

    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    location ~* \.(woff2?|png|jpe?g|webp|svg)$ {
        expires 7d;
        add_header X-Content-Type-Options "nosniff" always;
        add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    }

    error_page 404 /404.html;
    location = /404.html { internal; }

    location / {
        try_files $uri $uri.html $uri/ =404;
    }
}

The security headers are repeated in the image location, because a location that sets add_header drops the ones it would inherit. Create 404.html yourself, since a Wix copy may not include one. The internal flag means visitors cannot request that file directly.

Wix output that needs fixing on Nginx

Wix export: what to check
In the Wix outputWhat to do on any static host
Scripts from parastorage.com and wixstatic.comWix pages are rendered by JavaScript. Confirm the local script files load and no request still goes to Wix.
Wix backend featuresWix says standard sites cannot be hosted elsewhere, so Bookings, Stores, Members and forms stay on Wix. Replace each one.
Image URLs with resize steps in the pathPaths such as /v1/fill/w_ and h_ are sized for the live layout. Check image sharpness at wide screens.
Mobile and desktop layoutsWix builds layouts for several widths. Test at phone and desktop width before you switch the domain.

Check the network tab for requests to wixstatic.com and parastorage.com, which mean a page still depends on Wix. Replace forms, bookings, stores and member areas with outside services. Wix Studio owners should read Wix’s developer docs on code export, which was marked early-stage at the time of this review. Test at phone and desktop widths, because Wix builds a layout for each.

Forms and dynamic features

Nginx can proxy a POST to another service with proxy_pass but cannot process a form itself. Send the form to a form service or to an app you run on the same server.

Proxy a form post to a service with a single location block, or use a hosted form endpoint directly in the action attribute. Nginx will not keep the data.

What can go wrong

  • Server level headers vanish inside a location that sets its own add_header lines.
  • A missing 404.html makes error_page return an error of its own.
  • Pages that still call Wix servers fail when the Wix plan ends.

Frequently asked questions

Can I host a Wix site on my own Nginx server?

As a saved copy, yes. Wix says standard sites cannot be hosted elsewhere, so WebExport saves the public pages as files that Nginx can serve.

What does the always flag do on add_header?

Without it, Nginx adds the header only to certain status codes such as 200, 301 and 304. With always, the header is added to every response, including errors.

Why mark the 404 location as internal?

So the page is only used for errors, and a visitor requesting /404.html directly gets a 404 as well.

Does Nginx need a reload after I update the site files?

No. Content changes are picked up at once. Reload only after a config change, and run nginx -t first.

Official documentation

Free tools for this job

Get the Wix files first

Paste your public Wix URL into the export form and download a ZIP you can deploy to Nginx. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.