retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.7k stars 372 forks source link

Fixed nginx X-Forwarded-Proto to match the protocol ("http", "https") #617

Closed 0x6d61726b closed 1 year ago

0x6d61726b commented 1 year ago

According to the specification of X-Forwarded-Proto, the value shall match the used protocol (e.g., "http", "https") which is provided as scheme variable in nginx.

0x6d61726b commented 1 year ago

After my browser cache has expired, Gunicorn webserver returned a "Contradictory scheme headers" error. According to https://github.com/benoitc/gunicorn/issues/1857 Gunicorn uses the X-Forwarded-Proto value as protocol used between the proxy and itself, whereas X-Forwarded-Proto is defined as protocol between client and proxy.