How to serve a static HTML page on


To serve a static HTML page on


You will need:


In addition to your HTML file, needs three YAML files to configure an application in a project. These files define the routing, configure the web server, and set minimal defaults for everything else.


1. Set git remote to project

$ git init
$ platform project:set-remote <project id>

2. Create your HTML file:


<!DOCTYPE html>
    <p>Hello World</p>

3. Define routes


    type: upstream
    upstream: htmlhowto:http

4. Add empty services


# empty

5. Add


# The name of this app. Must be unique within a project.
name: htmlhowto

# Any type will work. There is no "plain HTML" type.
type: "python:3.7"

# There is no need for a writable file mount, so set it to the smallest possible size.
disk: 256

# Configure the web server to serve our static site.
        # Run a no-op process that uses no CPU resources, since this is a static site.
        start: sleep infinity

        # This tells Nginx to serve from the base directory
            root: "web"
                - "index.html"

This is a stripped down application configuration for serving a static file on You can find more information about additional commands that can be included in in the documentation.

6. Add, commit, and push these files to your empty project

git add .
git commit -m "Adding configuration to serve a static html file"
git push platform master

7. Test by visiting the URL of your environment.



By adding a route to routes.yaml, and by adding the proper web server configuration to, a project is able to serve static HTML files.

Is it possible to remove the trailing slash?

Unfortunately, it not possible. We use the following Nginx directive try_files $uri $uri/ =404; which is not customizable by users. As explained in the try_file documentation, if Nginx cannot match the URL path as a file it will try to match it as a directory. The path will always match the existing directory whether it ends with a slash or not.

1 Like

There is a way to catch the 404, but it is not officially supported: