How to host a Framer export on Nginx

Short answer

To host a Framer export on Nginx, copy the unzipped folder to your web root, add a server block, enable gzip for text files, and run nginx -t before reloading. Check that .mjs files are served as JavaScript, set caching with expires, and rebuild Framer redirects as rewrite or return rules.

Last reviewed

Key facts

  • Framer says a published site cannot be exported as plain HTML, so the copy is a saved render.
  • gzip is off by default and gzip_types defaults to text/html only.
  • The expires directive sets both the Expires header and Cache-Control max-age.
  • Redirects set in Framer settings must be recreated in the Nginx config.

What a Framer export brings to Nginx

A Framer export is a folder of rendered pages and JavaScript modules, and Nginx is happy to serve it. Out of the box, two things need a decision. Compression is off, and script modules may not have the right content type. Both are one line each, and both change how fast the page feels.

Framer pages run a lot of JavaScript on load, so transfer size matters. Turning on gzip for JavaScript, CSS, JSON and SVG cuts what travels over the network, and a short cache time keeps updates flowing after a re-export.

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 configuration turns on gzip for the file types a Framer site uses, caches scripts for an hour and adds a safety header to every response.

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

    gzip on;
    gzip_vary on;
    gzip_types text/css text/javascript application/javascript application/json image/svg+xml;

    add_header X-Content-Type-Options "nosniff" always;
    error_page 404 /404.html;

    location ~* \.(mjs|js|css)$ {
        expires 1h;
        add_header X-Content-Type-Options "nosniff" always;
    }

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

    location = /work { return 301 /projects; }
}

The nosniff header appears twice on purpose. A location block that sets any add_header replaces the headers inherited from the server level, so the line must be repeated there. If .mjs files arrive as application/octet-stream, add a line mapping the .mjs extension to a JavaScript type in your mime.types file. The /work redirect is a sample.

Framer output that needs fixing on Nginx

Framer export: what to check
In the Framer outputWhat to do on any static host
Script modules from framerusercontent.comFramer pages hydrate with JavaScript modules. Open the network tab and confirm no request still goes to framerusercontent.com.
Animation that starts on loadA missing script path can leave elements hidden or unanimated. Compare the first screen against the live site.
Forms that submit to FramerForms built with Framer’s own components post to a Framer service. Switch them to a form endpoint you control.
Redirects set in Framer settingsThey live in Framer, not in the files. Rebuild them in the host’s own redirect format before the domain moves.

Open the site with the network tab running and look for framerusercontent. Each match is a path to edit in the HTML. Check the content type of one .mjs response, because a browser refuses a module script served with the wrong type. Then rebuild the redirects from Framer settings and switch any Framer form to an endpoint you control.

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.

Use proxy_pass on a single path to hand form posts to a form service or an app on your server. Nginx does not store or email submissions.

What can go wrong

  • The add_header inheritance rule drops server level headers inside any location that sets its own.
  • gzip_types defaults to text/html, so scripts and styles stay uncompressed until you list them.
  • A cache time that is too long keeps visitors on old scripts after a re-export.

Frequently asked questions

Why is my Framer page blank on Nginx?

Most often a module script returned 404 or the wrong content type. Open the console and the network tab, find the failing request and fix the path or the mime type.

Should I enable gzip for a Framer export?

Yes for text files. gzip is off by default in Nginx and gzip_types covers only text/html, so list CSS, JavaScript, JSON and SVG yourself.

What does the expires directive do?

It sets the Expires header and a matching Cache-Control max-age for responses. A positive time becomes max-age in seconds, and off leaves the headers alone.

Can I run several exported sites on one Nginx server?

Yes. Give each site its own server block with its own server_name and root, then reload once.

Official documentation

Free tools for this job

Get the Framer files first

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