I have a python application running using BottlePy.
This application is routed by Nginx:
listen 443;
ssl on;
...
location / {
include uwsgi_params;
uwsgi_param UWSGI_SCHEME https;
uwsgi_pass unix:///var/run/uwsgi/uwsgi.sock;
}
Because I’m using the BottlePy micro-framework, I can’t call request.is_secure() (No such method).
But is there a way to read the UWSGI_SCHEME value from code?
My goal is to be sure, from code, that the request used HTTPS.
request.environwas indeed the way to go.http://bottlepy.org/docs/dev/api.html#bottle.BaseRequest.environ
Thanks to Mike for pointing me the right direction.
Will print the scheme of the URL: http/https…