[BlueOnyx:25672] Re: Site with multiple IP
Michael Stauber
mstauber at blueonyx.it
Sun Oct 30 04:24:50 -05 2022
Hi Apu,
> One small problem with this is that the "siteX.include" file is included
> in the "siteX" file before the end of the <VirtualHost> declaration.
> Apache does not let you nest one VirtualHost inside another.
>
> The solution is to move the
>
> Include /etc/httpd/conf/vhosts/siteX.include
>
> after the </VirtualHost> line though, of course, the siteX file will get
> overwritten by the GUI and you're back to the beginning again.
Yeah, the bottom line is there is no good way to support Vsites with
more than one IP on BlueOnyx. That is such a niche problem that I'm also
not really inclined to implement it out of the box in a proper fashion.
On second thought: There is a way. It's a bit freakish, though. And
future Updates or changes made via the GUI won't revert it back:
Force the Vsite to use HTTPS by enabling HSTS for it. Enable Nginx as
SSL-Proxy in the GUI. Then in /etc/nginx/vsites/ throw in a new Nginx
config file for that Vsite with a different name and change the IP
address in the copy to the second IP address that your site is supposed
to have.
The GUI will only ever mess with Nginx config files that match the exact
group name of existing Vsites (site1, site2, site3 and so on) and will
ignore anything else. So if you throw in an "extra_ip_site" config file,
then Nginx will use it, but the GUI will never touch or remove that file.
The only problem you'll have is: If a first time visitor tries to reach
the Vsite on the extra IP via HTTP (and not HTTPS), then the connection
won't terminate at the Vsite, as Apache wouldn't know what to do with
the request.
UNLESS: You set up a dummy Vsite as first Vsite on that extra IP and
have it redirect to the HTTPS URL of the Vsite in question.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list