Using on or Symfony Cloud

This knowledge base article explains how to setup and configure on 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 What is Symfony Cloud? 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

Some legal stuff: while we believe that both 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 mainly provide instructions for If you deploy your project on Symfony Cloud, the principles are the same, only a few terms change:

  • the .platform folder is named .symfony
  • the file is named

Install layout 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, does not provide a native 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 application layout:

A simple project running a Web application

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

A project using the agent

In this setup, the incoming HTTP(s) requests are routed to the 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:

Deploy on

This will create a base project with installed:

A project based on the template

Setup your application

First, setup your application with as you would do without using So, for an application named app, here is the traditional architecture:

├─ .platform
   ├─ routes.yaml        # defines the routes of the platformsh deployment
   └─ services.yaml      # defines the services required by the application
├─ app/                  # contains your application code
   └─ index.html
└─    # the "app" application configuration

The .platform/routes.yaml file defines how to route the traffic within the app. Usually, you will want to send all the traffic to your application:

    type: upstream
    upstream: "example-app:http"

    type: redirect
    to: "https://{all}/"

The .platform/services.yaml can be left empty, if your app does not have an external dependency. Else, you can add one of the supported services. In, configure the platformsh application (name, disk size, type of application, etc.). For example:

name: example-app
type: golang:1.15
    flavor: none
disk: 128
            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 a application, as explained in the Multiple applications documentation guide.

First, create a second application:

└─ redirectionio
   ├─  # the "redirectionio" application configuration
   └─ 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
datadir: "${PLATFORM_APP_DIR}/rules"

logging: true

# Run the agent as a reverse proxy
       listen: "${PORT}" # Listen endpoint
       forward: "http://app.internal" # Remote endpoint
       project_key: "${REDIRECTIONIO_KEY}" # Project key to use
       preserve_host: true # Preserve host header, defaults to false
       request_body_size_limit: 20MiB # accept requests with max. 20MB body size

# Sets log configuration. Each section is optional and independent of one another.
# log:
#   file:
#       level: info
#       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 proxies: section. In particular, you may want to set the request_body_size_limit directive in order to configure the maximum request size.

In redirectionio/, define the application configuration:

# /redirectionio/
name: "redirectionio-agent"

type: golang:1.15

    flavor: none

disk: 128

    app: "example-app:http"

    build: |
        set -ex
        curl -s -J -L "" | tar -C /app/ -xzpf -

        socket_family: tcp
        protocol: http
        start: |
            set -ex
            /app/redirection-agent/redirectionio-agent -config-file ./agent.yaml
            allow: false
            passthru: true

    # rules will be saved locally in this folder
        source: local
        source_path: rules
    # log folder
        source: local
        source_path: log

There's not much to explain about this application:

  • the disk directive defines the size of the attached disk. Depending on your ruleset size, and your agent configuration about data persistence, you may want to increase this value;
  • the type of the image used is golang, but you can use any of the available types. It happens that the golang image is the smallest one;
  • the node downloads the latest release of the agent at build time;
  • the node allows to "link" both applications. Changing this name requires to also change the proxies[0].forward node in the agent.yaml file;
  • the web.command.start node defines how to start the redirectionio-agent binary with the right configuration;
  • the mounts section defines paths that must be made writable to the agent

The hook above downloads and installs the last available version of the 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 project key (in the "instances" screen of the manager, click on the "Setup on your infrastructure" button), add this key as a project variable, which will help keep this key secret (and shared across your team):

$ platform variable:create --name env:REDIRECTIONIO_KEY --sensitive true --value "set your key here"

Last step, change the .platform/routes.yaml file to instruct to route the incoming traffic to the newly created redirectionio-agent application instead of the app application:

# .platform/routes.yaml
    type: upstream
    upstream: "redirectionio-agent:http"

    type: redirect
    to: "https://{all}/"


Once the changes have been made, commit and push to the platform remote. This will trigger a new deploy of your project:

$ git commit -m "let's use"
$ git push

(things happen)

Processing activity: John Doe pushed to Master
    Found 1 new commit

    Building application 'example-app' (runtime type: golang:1.15, 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.15, tree: 2fd5612)
      Generating runtime configuration.
      Executing build hook...
        W: + curl -s -J -L
        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.15, size: S, disk: 128)
        redirectionio-agent (type: golang:1.15, size: S, disk: 128)

      Environment routes redirects to redirects to is served by application `redirectionio-agent` redirects to

Send a HTTP(s) request to your application URL, and you should see some traffic logged in the manager. You can now audit your traffic, create redirects and fix SEO errors with ease!

Next step, learn how to create your first redirections!

This page has been updated on April 18th, 2024.
Can't find your answer?