Auto detect internal/external development environment

后端 未结 5 700
清歌不尽
清歌不尽 2021-02-04 14:04

We use the following function to auto detect if we are on a machine internally or on a live server and then choose the appropriate configs for various components:



        
5条回答
  •  轮回少年
    2021-02-04 14:47

    Adding to Andy Shellam's answer..

    If you are using mod_vhost_alias, or have various domains with the same (virtual) document root, you can set the variable dependent upon parameters, e.g.

    SetEnvIf SERVER_ADDR x.x.x.x APPLICATION_ENV=development
    SetEnvIf HTTP_HOST abc.example.com APPLICATION_ENV=development
    

提交回复
热议问题