Rethink how proxied headers are handled

- Request Apache to send X-Forwarded-Proto header.

- Use X-Forwarded-Proto header to understand original protocol
  requested.

- Use X-Forwarded-Host header to understand original host requested.

- Allow any incoming host header so that FreedomBox can have any
  hostname and when user requests for Plint with that hostname, it
  works.

- Don't depend on Apache to rewrite the Location: header.  Instead use
  the original host and original scheme to set proper Location: header.
This commit is contained in:
Sunil Mohan Adapa committed 2014-11-30 15:11:50 +05:30
1 parent eec249d006
commit 1b6969a8a6
5 files changed
+47 -5

No files matched your search

@@ -5,7 +5,8 @@
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
## Use HTTP Strict Transport Security to force client to use secure connections only
## Use HTTP Strict Transport Security to force client to use secure
## connections only
Header always set Strict-Transport-Security "max-age=31536000"
## Shared options.
@@ -28,7 +29,7 @@
## Make sure to provide plinth with a default directory: /plinth
<Location /plinth>
ProxyPass http://localhost:8000/plinth
ProxyPassReverse http://localhost:8000/plinth
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
Order Deny,Allow
Deny from All