I set up python/flask/uwsgi+nginx web app and it works fine. I want to use geoip, I set it up on nginx side:
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/qbaka-visit.sock;
...
uwsgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
}
But now I don't know how to read this property in python. Prior to uwsgi I used simple flask builtin webserver + nginx proxy_pass, in which case I used proxy_set_header X-Geo-Country $geoip_country_code; and read this argument using request.headers, but for UWSGI params I couldn't figure out how to read them.