When you want to add a domain to Lumen, it is sometimes unclear where that domain should fit into your existing account, application, and environment structure. This guide will help you decide whether it is most appropriate to create a new application, create a new environment, or add a new domain to an existing environment.
My new website is a staging/uat site for a production site that I have running or want to run on Lumen
The purpose of Lumen’s application-environment structure is to streamline the configuration testing and promotion process for modules in your stack. With respect to configuration, the definition of an application is a git repository, and the definition of an environment is a branch within that repository. This makes testing changes to the staging environment and then promoting them to the production environment as simple as a git merge and push.
If you want to add a staging site to Lumen, the best solution for most use cases is to add a new environment to the same application (or use the Staging environment that comes by default whenever you create a new environment).
Summary: we recommend adding a new staging site to an existing application as a new environment.
I want to add a new website to Lumen that is similar to one or more sites I already have running on Lumen
Lumen maintains running containers for each module in your stack in each point of presence on a per environment basis. That means that if you assign www.example.com and www.demonstration.com to the same Lumen environment, the same containers will handle traffic for both sites. If you have a new site that has similar needs and configuration patterns to a site that is already running on Lumen, then assigning both domains to the same environment greatly simplifies the overhead of managing them.
When two sites have the same URI patterns for resources and routes that should and should not be cached (i.e. both are set up for HTML caching and use the same routes for admin functionality or checkout), then it often makes sense to assign both of these domains to the same environment.
It is even possible to assign two domains to the same environment when the websites are running on different origin servers. Lumen supports routing requests to alternate origins based on the incoming request’s hostname or other criteria.
If the websites are mostly the same but have a few important differences, you can manage this as well within a single configuration by building hostname specific logic into your Varnish Cache Configuration: