.upsun/config.yaml
https://{default}/foo/index.html to https://www.example.com/foo/index.html.
You can also define a proxy route to an URL composed of an IP address and a port:
.upsun/config.yaml
URL paths
In the basic example above, the route preserves the URL path,/foo, in the request.
If you want to proxy a route to https://www.example.com without the URL path /foo,
add a trailing slash / to the to definition.
.upsun/config.yaml
https://{default}/foo/index.html are forwarded to https://www.example.com/index.html.
To override the URL path entirely, define a route that contains its own path.
For example:
.upsun/config.yaml
https://{default}/foo/index.html to https://www.example.com/bar/index.html.
Multiple apps with the same base URL
You can use proxy routes to map a single domain to multiple Upsun projects with their own subdomain/domain names. You might have a need to access multiple projects, each hosting specific applications for different languages. You want to serve them all at the same base URL with different paths (https://example.com/en, https://example.com/fr, and so on).
Because domains can’t be reused at Upsun, you can’t just set the same domain for all projects.
Use proxy routes so a single project can access different projects using the same base URL.
In the following example, a single project specifies proxy routes to three apps with the same default base URL.
Each app handles a different language.
.upsun/config.yaml
https://en.example.com/style.css to https://example.com/en/style.css.
The following diagram shows the example project forwarding specific requests to the correct app.