Skip to main content
Static site generators are a popular way to create fast sites. Because there’s no need to wait for responses from servers, the sites may load faster. To learn how to serve your static site using Upsun, you can start with the required minimal app configuration and build on it, or jump straight to an example of a complete configuration.

Minimal app configuration

To successfully serve a static site using Upsun, you need to set up a minimal app configuration similar to the following: See more information on the required minimal settings:

Add more features

Allow static files but not dynamic files on PHP containers

If you have a PHP container, you might want to enable client-side scripts but disable server-side scripts. To enable static files that don’t match any rule while disabling server-side scripts on a PHP container, use the following configuration: See more information on locations properties.

Create cache rules

You can create sensible cache rules to improve performance. For example, if you publish new content regularly without updating images or site files much, you might want to cache text files for a day but all image files for longer. To do so, use a configuration similar to the following: You can also set a Cache-Control header in your rules. If expires and a Cache-Control header are set, the rule ignores the expires and sets only the Cache-Control header. For this reason, make sure to add a max-age value, in seconds, for the Cache-Control header.

Conserve the server

Because your site is completely static, it doesn’t need the server to be running. To set a background process that blocks the server and conserves resources, use the following configuration: You can also use this place to start small programs, such as a script to handle 404 errors.

Complete example configuration

Last modified on March 10, 2026