Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support https reverse proxying #466

Closed
anonymous-piwik-user opened this Issue · 12 comments

3 participants

@anonymous-piwik-user

I’m using Piwik behind a Apache 2 reverse proxy.

Here is my configuration:

Internet → Apache 2 (http, OR https) -(reverse proxying)→ lighttpd (http) hosting piwik.

Since the Piwik login page use a absolute URL for the login form, even if i access the Apache 2 reverse proxy using:

https://piwik.domain.com/

the login form action use the protocol value detected from lighttpd:

http://piwik.domain.com/

This is an issue. The solution is to add an option to disable complete URL for forms. (so that the action is just / in stead of http://piwik.domain.com.

This would allow to use different protocols between reverse proxy and actual piwik http server. Keywords: reverse proxy login https

@robocoder

This actually sounds like a bug in the reverse proxy.

@anonymous-piwik-user

Actually it is more of a feature request than a bug.

The reverse proxy can not tell the web server behind if it use http or https. Since the web server behind the reverse proxy does not use https, but http. Piwik believe that it use http.. but for the user that see only the reverse proxy, piwik is on https.

so, with a url https://piwik.domain.com, the form created by piwik point to http://piwik.domain.com

So i’m requesting a feature that allow to disable the complete url for form, or to tell piwik that it should use https instead of http.

At the end, it the web application responsability to offer such a feature. For example, phpmyadmin allow it.

@robocoder

Have you configured your reverse proxy to use ``` SSLProxyEngine On ``` ?

@anonymous-piwik-user

Hi,

I’ve just tried it, without anything else, in my Apache 2 config. It has no visible effect. After digging a little, it seems that it is needed to do reverse proxy with a https site in backend:

https → proxy → https

My configuration use piwik in HTTP:

https → proxy → http

This morning, while playing with Piwik, i’ve found out that Piwik worked well either in HTTP or in HTTPS. The only problem i have with HTTPS is with the login form.

The action of the login form is http://piwik.domain.fr/index.php?module=CoreHome&action= even when i’m accessing piwik in HTTPS.

Would it be a security issue to use relative URL for the login form ? Something like :

/index.php?module=CoreHome&action=

This would bypass the problem. This could be an Piwik option that enable people using https to http reverse proxy to use Piwik without problems.

@robocoder

Attachment: Thanks for clarifying your set-up. I’ve attached a sample reverse proxy configuration using mod_proxy_html to rewrite the login form’s action URL. Other than masking some information about my set-up, this is the configuration I tested. It might still need a little “magic” (e.g., ProxyHTMLLinks for some legacy html elements). [virtualhost.conf](http://issues.piwik.org/attachments/466/virtualhost.conf)

@robocoder

See patch

@robocoder

Attachment: [466.diffs](http://issues.piwik.org/attachments/466/466.diffs)

@mattab
Owner

have committed patch from vipsoft, please close ticket if that actually fixes the bug. thanks!

@mattab
Owner

I close it because of missing feedback; when next release is published, if you still experience the issue, please reopen the ticket.

@anonymous-piwik-user

without using the provided virtualhost (that use mod_proxy_html), the patch fixe half of the problem:

when accessing to login form in https, the form is submitted over https, so the password is not sent over the network in plain text.

but once logged in, the user is redirected to the http connection (probably due to the fact that form_url hidden input is something like “http://…”.)

as said before, my setup is “HTTPS -- reverse proxy —→ HTTP”.

so i leave this bug as closed… but without using mod_proxy_html, or https on the server behind the reverse proxy.. it just allow to have password protected by https

@mattab
Owner

landure of others, if you can think of any way to fix something in Piwik to make it work with your setup let us know by commenting here. how other php projects handle this problem for example?

@robocoder

(In [1155]) fixes #691 - use relative URLs (except in Widgetize iframe & flash embed
code); refs #466 and #647 - should also resolve the reverse proxy issues

@anonymous-piwik-user anonymous-piwik-user added this to the RobotRock milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.