How to restrict the staging environment in Openshift from being accessed by others

287 Views Asked by At

I have been reading about release management for Openshift and have found a nice process described in Openshifts official blog. According to this process you develop the application locally, then deploy it to a staging environment and in the end, when everything is working, you deploy it to production.

The information I am looking for, but can't find, is how to restrict the access to the staging environment. This environment should only be used by me to test the application in a production-like environment and should not be accessible by other people. Is there a way to do this?

1

There are 1 best solutions below

0
On

Using the PHP cartridge allows you to do this in a couple of different ways:

  • Using an .htaccess file

  • Using PHP

    • You can also use php code to block access to your website by checking the visitors ip address, along with the existence of an environment variable something like:

    if ($visitors_ip != "x.x.x.x") { exit(); }