can't log in or create new users on mediawiki
geoff at uplex.de
Mon Aug 17 08:24:44 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
On 8/17/15 5:29 AM, Tim Dunphy wrote:
> I've setup my mediawiki behind varnish. Since doing that I am
> unable to either create new users or log into the wiki itself.
I don't know how it works with mediawiki, but let's talk about regexen
> req.http.host ~ "^wiki\.example\.com$"
If you're going for an exact string match -- '^' followed by a fixed
string followed by '$' -- you might as well just compare for string
req.http.host == "wiki.example.com"
That might be a little faster, and it makes the intention of your code
> req.url ~
thing here, with the additional problem that '.', '?' and '+' are
regex metacharacters. "index.php?" will match "index.ph" possibly
followed by a "p", but it won't match the question mark (it also
matches anything where the dot is). "Main+" will match "Mai" followed
one or more "n"s, but it won't match the plus sign.
So your idea may or may not work with mediawiki, but at any rate the
regex matches were failing.
If you're sure you're looking for those exact strings, just use the
Are you certain that the URLs of interest will always be written
exactly those two ways? No one will ever use '/' instead of
'/index.php', and the key-value pairs in the query string will always
be in exactly that order?
If not, you'd be better off using regexen after all, something like this:
req.url ~ "^/(index\.php)?" && req.url ~ "foo=bar"
&& req.url ~ "baz=quux"
Meaning: the path must be '/' possibly followed by 'index.php', and
the key-value pairs must all appear (in any order).
Again, this is just to ensure that you're identifying the URLs you're
looking for, I can't say if mediawiki will then do as you expect.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
-----END PGP SIGNATURE-----
More information about the varnish-misc