Authentic staging environment

I want to create an authentic staging environment where it will function
precisely as it does in the production environment.

Given some plugins, e.g. asset packager, will behave differently if it’s
not in ‘production’ environment, I figure it’s best to run the staging
server in ‘production’ as well, rather than creating a new ‘staging’
environment. Is this the correct way of doing this?

If so however, the staging server does need a slightly different
configuration in order to communicate differently to the email server. I
am having difficulty thinking of a way of doing this if they are both in
‘production’ environment.

I thought perhaps I could set another variable in mod_rails which can be
picked up in Rails. Though having scanned the documentation nothing
obvious sticks out.

Any advice is greatly appreciated.

A staging site is a very good idea: however you should have it on a
different server with the same setup as your production server, since
you’re inevitable going to be stopping and restarting it a lot and this
will affect the performance of your live site (not to mention make it
break completely when you restart nginx/apache/whatever) if they’re
sitting on the same box. It should run in production as you say.

Thanks for the reply. They are indeed on separate servers.

I ended using these environment names:
development_server - to differentiate from ‘development’ which is used
locally
staging
production

I added ‘staging’ to merged_environments for asset_packager so that it
merges asset files(js/css) on ‘staging’, using this:

Synthesis::AssetPackage.merge_environments = [“staging”, “production”]