Welcome! Log In Create A New Profile

Advanced

Re: Possible to make subdomain only accessible through 'embed'

All files from this thread

File Name File Size   Posted by Date  
ghhdhhpkijhodmio.png 9.4 KB open | download Jore 03/12/2021 Read message
Francis Daly
March 18, 2021 04:36PM
On Wed, Mar 17, 2021 at 11:21:58PM +1100, Jore wrote:
> On 17/3/21 8:22 pm, Francis Daly wrote:

Hi there,

> > Alternatively: if you were to reverse-proxy the MediaWiki instance at
> > docs.domain.com/embed/, then you could potentially set a cookie on
> > docs.domain.com, and require that a suitable cookie is present for any
> > requests to docs.domain.com/embed/.
> >
> > That might be the closest to what you want?
>
> Is this all possible through a nginx config? If so, are there some examples
> you could point me to?

I have not tried it; but some web searching indicates that it is possible
to install MediaWiki to be below /embed/ on the embed.domain.com server;
and you might also be able to set $wgServer to tell it that it "really" is
on the docs.domain.com server, and you can optionally set $wgSquidServers
so that MediaWiki will use the X-Forwarded-For header.

In that case, the nginx side would basically be

location ^~/embed/ {
proxy_pass http://embed.domain.com;
}

And you might want to include "proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;" or similar things too.

Also in that location{}, you would do whatever tests you want, to see if
this request should be allowed or not. That might be an "if $cookie",
or a fuller auth_request, or something written in one of the embedded
languages.

In this case, the first allow-or-not decision is made on the nginx side,
without involving MediaWiki at all.

> Or do you know if I'd have to get Mediawiki modified to do something like
> this?

I don't think a MediaWiki code change would be needed. There might be
useful config changes that could be made, but may not be compulsory. I
suspect that things would work more cleanly if MediaWiki knows that it
is below /embed/ instead of being at /; but it might be possible to work
in the latter case.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Possible to make subdomain only accessible through 'embed' Attachments

Jore March 12, 2021 03:58PM

Re: Possible to make subdomain only accessible through 'embed'

Francis Daly March 14, 2021 10:52AM

Re: Possible to make subdomain only accessible through 'embed'

Jore March 15, 2021 01:26AM

Re: Possible to make subdomain only accessible through 'embed'

Francis Daly March 17, 2021 05:24AM

Re: Possible to make subdomain only accessible through 'embed'

Jore March 17, 2021 08:24AM

Re: Possible to make subdomain only accessible through 'embed'

Francis Daly March 18, 2021 04:36PM

Re: Possible to make subdomain only accessible through 'embed'

Ian Hobson March 17, 2021 11:00AM

Re: Possible to make subdomain only accessible through 'embed'

Jore March 18, 2021 08:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready