2013-04-16 7 views

risposta

26

Il proxy può aggiungere intestazioni extra (o sovrascrivere) alle richieste che riceve e passa al back-end. Questi possono essere usati per comunicare informazioni al back-end.

Finora ho visto un paio utilizzato per forzare l'uso di https in schema URL:

X-Forwarded-Protocol: https 
X-Forwarded-Ssl: on 
X-Url-Scheme: https 

E wikipedia menziona anche:

# a de facto standard: 
X-Forwarded-Proto: https 
# Non-standard header used by Microsoft applications and load-balancers: 
Front-End-Https: on 

Questo ciò che si dovrebbe aggiungere alla VirtualHost on : altri proxy devono avere una funzionalità simile

RequestHeader set X-FORWARDED-PROTOCOL https 
RequestHeader set X-Forwarded-Ssl on 
# etc. 

Penso che sia meglio impostarli tutti, o impostarne uno che funzioni e rimuovere quelli noti. Per evitare che i malvagi clienti si prendano cura di loro.

+2

È X-Forwarded-Proto, non X-Forwarded-Protocol, giusto? – mmoya

+2

@mmoya Li ho visti entrambi. Quest'ultimo vince anche in un [googlebattle] (http://www.googlebattle.com/?domain=x-forwarded-proto&domain2=x-forwarded-protocol&submit=Go%21). –

+6

[RFC 7239: estensione HTTP inoltrata] (https://tools.ietf.org/html/rfc7239) :) – mmoya

Problemi correlati