简体   繁体   中英

Nginx + Passenger + GeoIP: Can't pass variable value to application

So I'm installing a new server with Nginx v. 1.8, Rails 4.2 and Paasenger v. 5.0.21 and I'm trying to send GeoIP variables to the application this way:

passenger_env_var HTTP_GEOIP_COUNTRY_CODE US;
passenger_env_var HTTP_GEOIP_VISITING_COUNTRY $geoip_country_code;

The first variable is correctly defined in the ENV hash in the application, but the second variable is set to "$geoip_country_code" instead of the country code detected by the GeoIP library.

I know that GeoIP is properly configured because I created a log_format and logged the value of the $geoip_country_code variable, with favorable results.

Does anybody know the right way to pass a Nginx variable as a Passenger Env Var?

Thanks.

Github上已经回答了这个问题: https : //github.com/phusion/passenger/issues/1664

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM