The instructions below have been customized for your project "".
Customize these instructions for the project
Upsun integration
This page explains how to setup and configure redirection.io on Upsun (formerly platform.sh) or Symfony Cloud hosting environments, in order to let your SEO or marketing team check the HTTP traffic and fix SEO issues in an easy and flexible way.
What is Upsun? What is Symfony Cloud?
Upsun is a PaaS: it provides a fully managed hosting environment, built to ease up the setup of a scalable and maintained hosting platform. The goal of such hosting providers is to provide an efficient way to build feature-full Web platform, without the need for a complex infrastructure design or repetitive ops or sysadmin operations.
Shortly said, Symfony Cloud is a commercial offer tailored for the Symfony framework, and built on the technical platform of Upsun (formerly platform.sh).
Some legal stuff: while we believe that both Upsun and Symfony Cloud do a great job, this guide does not imply that we endorse or advise their services. They own their trademarks, we are not affiliated, etc. etc.
In the rest of this guide, we will provide instructions for Upsun (Flex). If you deploy your project on Upsun Fixed (formerly platform.sh), the principles are the same, only a few terms change. You can read the migration guide on Upsun website.
Install layout
Upsun proposes many services out of the box (Elasticsearch, Memcached, Varnish, etc.) that can be enabled in a hosted project with only a few lines of YAML. Unfortunately, Upsun does not (yet) provide a native redirection.io integration (which would be useful, isn't it?), but it is possible to get it running in a performant way with few configuration.
A schema is worth thousand words, so here is a standard Upsun application layout:

And here is the layout that is going to be used with the redirection.io agent installed:

In this setup, the incoming HTTP(s) requests are routed to the redirection.io agent in reverse-proxy mode, then passed to the applicative backend. The redirectionio-agent http(s) reverse-proxy is very performant and does not have a significative nor noticeable impact on overall performance, which makes it an ideal solution to fix SEO issues on the fly, at the edge of your infrastructure.
If you are busy and want to test our solution right away, please click this button to use a pre-defined project template:
This will create a base Upsun project with redirection.io installed:

Setup your application
First, setup your application with Upsun as you would do without using redirection.io. So, for an application named app, here is the traditional architecture:
ββ .upsun
ββ config.yaml # defines the routes and the services required by the application
ββ app/ # contains your application code
ββ index.html
The .upsun/config.yaml file defines how to route the traffic within the Upsun app. Usually, you will want to send all the traffic to your application:
routes:
"https://{default}/":
type: upstream
upstream: "example-app:http"
"https://www.{default}/":
type: redirect
to: "https://{default}/"
In the .upsun/config.yaml file, you can also configure the Upsun application (name, disk size, type of application, etc.). For example:
applications:
example-app:
type: golang:1.25
web:
locations:
"/":
root: "app"
passthru: "/index.html"
Setup the redirectionio-agent
As the redirectionio-agent is a simple binary with no external dependency (no database, etc. is required), you just have to install the agent binary as an Upsun application, as explained in the Multiple applications documentation guide.
First, create the configuration for the redirection.io agent:
ββ redirectionio
ββ agent.yaml # the redirectionio-agent configuration
In redirectionio/agent.yaml, define the redirectionio-agent configuration directives as explained in our documentation:
# /redirectionio/agent.yaml
instance:
name: "${PLATFORM_ENVIRONMENT}"
# Directory where the rules will be persisted
persist: "${PLATFORM_APP_DIR}/rules"
logging: true
# Run the agent as a reverse proxy
reverse_proxy:
listen:
- "tcp://0.0.0.0:${PORT}" # Listen endpoint
forward:
address: "app.internal" # Remote endpoint
agent:
project_key: "${REDIRECTIONIO_KEY}" # Project key to use
# Optional agent technical logs
# log:
# -
# output: file
# format: text
# path: "${PLATFORM_APP_DIR}/log/agent.log"
Of course, you can adapt the instance_name (here, it is generated based on the PLATFORM_ENVIRONMENT environment variable).
All the agent proxies configuration directives can be used in the reverse_proxy: section.
Edit .upsun/config.yaml, to add the redirectionio-agent application configuration:
applications:
redirectionio-agent:
type: golang:1.15
disk: 128
hooks:
build: |
set -ex
curl -s -J -L "https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_amd64.tar.gz" | tar -C /app/ -xzpf -
relationships:
app: "example-app:http"
web:
upstream:
socket_family: tcp
protocol: http
commands:
start: |
set -ex
/app/redirection-agent/redirectionio-agent --config ./agent.yaml
locations:
"/":
allow: false
passthru: true
mounts:
# rules will be saved locally in this folder
'rules':
source: local
source_path: rules
# redirection.io log folder
'log':
source: local
source_path: log
# Your original application configuration
example-app:
type: golang:1.25
web:
locations:
"/":
root: "app"
passthru: "/index.html"
There's not much to explain about this application:
- the
diskdirective defines the size of the attached disk. Depending on your ruleset size, and your redirection.io agent configuration about data persistence, you may want to increase this value; - the
typeof the image used isgolang, but you can use any of the available types. It happens that the golang image is the smallest one; - the
hooks.buildnode downloads the latest release of the redirection.io agent at build time; - the
relationships.appnode allows to "link" both Upsun applications. Changing this name requires to also change thereverse_proxy.forward.addressnode in theagent.yamlfile; - the
web.command.startnode defines how to start theredirectionio-agentbinary with the right configuration; - the
mountssection defines paths that must be made writable to the redirection.io agent
The hook above downloads and installs the last available version of the redirection.io agent software. If you wish to run a fixed version, you can of course replace the download URL - simply use one of the packages available in our repository.
Once you have found the redirection.io project key (in the "instances" screen of the manager, click on the "Setup on your infrastructure" button), add this key as an Upsun project variable, which will help keep this key secret (and shared across your team):
$ upsun variable:create --name env:REDIRECTIONIO_KEY --sensitive true --value "set your key here"
Last step, change the .upsun/config.yaml file to instruct Upsun to route the incoming traffic to the newly created redirectionio-agent application instead of the app application:
routes:
"https://{default}/":
type: upstream
upstream: "redirectionio-agent:http"
"https://www.{default}/":
type: redirect
to: "https://{default}/"
Benefits
Once the changes have been made, commit and push to the upsun remote. This will trigger a new deploy of your project:
$ git commit -m "let's use redirection.io"
$ git push
(things happen)
Processing activity: John Doe pushed to Master
Found 1 new commit
Building application 'example-app' (runtime type: golang:1.25, tree: e7f1eab)
Generating runtime configuration.
Executing pre-flight checks...
Compressing application.
Beaming package to its final destination.
Building application 'redirectionio-agent' (runtime type: golang:1.25, tree: 2fd5612)
Generating runtime configuration.
Executing build hook...
W: + curl -s -J -L https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_amd64.tar.gz
W: + tar -C /app/ -xzpf -
Executing pre-flight checks...
Compressing application.
Beaming package to its final destination.
Redeploying environment master
Preparing deployment
Closing services example-app, router, and redirectionio-agent
Opening application example-app and its relationships
Opening environment
Environment configuration
example-app (type: golang:1.25, size: S, disk: 128)
redirectionio-agent (type: golang:1.25, size: S, disk: 128)
Environment routes
http://master-XXXXXXXXXX.platformsh.site/ redirects to https://master-XXXXXXXXXX.platformsh.site/
http://www.master-XXXXXXXXXX.platformsh.site/ redirects to https://www.master-XXXXXXXXXX.platformsh.site/
https://master-XXXXXXXXXX.platformsh.site/ is served by application `redirectionio-agent`
https://www.master-XXXXXXXXXX.platformsh.site/ redirects to https://master-XXXXXXXXXX.platformsh.site/
Send a HTTP(s) request to your application URL, and you should see some traffic logged in the redirection.io manager. You can now audit your traffic, create redirects and fix SEO errors with ease!
Next step, learn how to create your first redirections!