I think I figured out the solution. Need to add one line to the nginx.conf: uwsgi_param UWSGI_SCHEME $scheme;
# HTTPS server server { listen 443; server_name ""; ssl on; ssl_certificate /opt/nginx/conf/server.crt; ssl_certificate_key /opt/nginx/conf/server.key; location / { uwsgi_pass 127.0.0.1:9001; include uwsgi_params; uwsgi_param UWSGI_SCHEME $scheme; } location /static { root /var/web2py/applications/init/; } }