Custom $_SERVER var via ISPConfig

Discussion in 'Installation/Configuration' started by natanfelles, May 30, 2023.

  1. natanfelles

    natanfelles New Member

    Hello!
    How to set a custom $_SERVER var via ISPConfig?
    I'm using nginx as webserver.
    This is what I do without ISPConfig to set $_SERVER['ENVIRONMENT']:
    location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_param ENVIRONMENT production;
    fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
    }
    Thank you very much!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use the ##merge## statement in the nginx directives field. See e.g. ISPConfig manual, page 150, for an example.
     
    natanfelles likes this.
  3. natanfelles

    natanfelles New Member

    Hello, Till!
    The following snippet solved my issue:
    Code:
    location @php { ##merge##
        fastcgi_param ENVIRONMENT production;
    }
    Thank you very much!
     
    till and ahrasis like this.

Share This Page