rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
643 stars 55 forks source link

ngx_var_get causes nginx to core dump #140

Open ne4u opened 2 years ago

ne4u commented 2 years ago

When using ngx_var_get to get nginx variables the function will core dump on some variables if they are not set.

EX: ngx_var_get("referer"); will result in a core if the header doesn't exist. it works if the header is set. The work around is to put this in the nginx config: set $ref $http_referer; and use: ngx_var_get("ref");

However, if one uses: ngx_var_get("https"); it will not core nginx if the variable https is not set in nginx