How to host a Webflow export on Nginx

Short answer

To host a Webflow export on Nginx, copy the unzipped folder to your web root, add a server block with root, index and try_files, then run nginx -t and reload. Use return or rewrite for moved URLs, and send Webflow forms to an outside endpoint, since Nginx cannot process a form submission itself.

Last reviewed

Key facts

  • try_files maps clean URLs to files, so /about can serve about.html.
  • rewrite with the permanent flag sends a 301, and redirect sends a 302.
  • Nginx ignores .htaccess files, which only Apache reads.
  • Webflow’s help says forms do not work in exported code.

What a Webflow export brings to Nginx

A Webflow copy from WebExport is a folder of pages, local CSS and scripts, fonts and images. Nginx serves it with no extra software, and the whole setup is one server block. You control the file layout, caching and redirects, which suits teams that already run a server and want the site next to their other projects.

The package also includes .htaccess and routing configs for Apache. Those have no effect on Nginx, so treat them as a reference for what routing the site expects and rewrite the same rules in Nginx syntax.

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.

Put this in a file under /etc/nginx/conf.d or in sites-available, then reload. It serves pages without .html, returns a real 404 and redirects a renamed CMS folder.

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

    error_page 404 /404.html;

    location = /home { return 301 /; }
    location ^~ /posts/ { rewrite ^/posts/(.*)$ /blog/$1 permanent; }

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

try_files checks the exact file, then the same name with .html, then a folder, and returns 404 if nothing matches. The home and posts rules are samples for a removed page and a renamed CMS folder. Use a map block instead of many return lines when you have a long redirect list. Run nginx -t before every reload.

Webflow output that needs fixing on Nginx

Webflow export: what to check
In the Webflow outputWhat to do on any static host
Forms handled by webflow.jsWebflow’s help lists forms as not working in exported code. Change each form action to a new endpoint and test a real submission.
Site search, Logic and membershipsThese run on Webflow’s servers. Remove the elements or replace them with a third-party service.
Lottie files and inline style backgroundsLottie animations load a JSON file from a data-src attribute, and inline styles can hold image URLs. Search the folder for website-files.com to catch leftovers.
CMS content frozen at export timeEach CMS item becomes an HTML file. A new post in Webflow shows up on your host only after you export again.

Point each Webflow form at an endpoint you control and test a submission. Nginx can pass a POST to another service with proxy_pass, but it cannot read the form itself. Remove Webflow site search, Logic and membership elements. Then search the folder for website-files.com, since Lottie data-src values and inline styles are where CDN links remain.

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.

A location block with proxy_pass can forward form posts to a form service or to an app on the same server. Keep the endpoint private to that one path.

What can go wrong

  • A syntax error in a config file stops the reload. nginx -t catches it before you restart.
  • try_files with $uri.html serves a page at both /about and /about.html, so add a redirect or a canonical tag to avoid duplicates.
  • Forgetting the certificate leaves the site on plain HTTP.

Frequently asked questions

Does the .htaccess file in the export work on Nginx?

No. Nginx ignores .htaccess, which only Apache reads. Translate its rules into server block directives.

How do I serve /about for about.html on Nginx?

Use try_files $uri $uri.html $uri/ =404 inside location /. Nginx then tries the exact file, the .html file and the folder in order.

How do I redirect old Webflow URLs on Nginx?

Use return 301 for a single path, rewrite with the permanent flag for patterns, or a map block for a long list. Test with curl -I on each old URL.

How do I update the site after a change in Webflow?

Export again, then run rsync with --delete to the web root. Nginx serves the new files at once, with no reload needed for content changes.

Official documentation

Free tools for this job

Get the Webflow files first

Paste your public Webflow 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.