Portal:Cloud VPS/Admin/Web proxy
The web proxy (aka dynamicproxy aka novaproxy aka Yuviproxy) mechanism powers the Cloud VPS web proxy service. It's powered by Nginx, OpenResty, a Redis backend and a Python API to manage it. The setup is hosted in the project-proxy
(proxy-codfw1dev
in codfw1dev) Cloud VPS project.
How to
Enable per-project subdomain delegation
To enable the use of a delegated wmcloud.org subdomain (or some other domain managed in Designate) on the proxy, follow these steps:
- Ensure a subdomain delegation is a good idea for the specific use case.
- Delegate the specific subdomain in Designate to the project using wmcs-makedomain if it's not delegated already. To check, see the domain listing in Horizon or in openstack-browser for that specific project.
- Provision the TLS certificates in the
project-proxy-acme-chief
prefix hiera:- Add the project ID to
profile::acme_chief::cloud::designate_sync_project_names
if not there already. - Add the names to an existing
profile::acme_chief::certificates
entry if there's a related zone already configured or add a new certificate definition. By convention, custom domains have certificates with names starting withcustom
, e.g.customtools
for Toolforge and Toolsbeta.
- Add the project ID to
- Run Puppet on the active project-proxy acme-chief host.
- Add the zone to
profile::wmcs::novaproxy::supported_zones
in theproxy
Hiera prefix. - Run Puppet on the proxy instances, starting with the passive.
Enable support for a custom domain
To enable the use of a custom (non-Designate managed) domain with the web proxy:
- Ensure a custom domain is a good idea for the specific use case.
- Ensure the domain name is pointed to the proxy following the instructions on Help:Using a web proxy to reach Cloud VPS servers from the internet#Vanity domains.
- Provision the TLS certificates by adding an entry to the
profile::acme_chief::certificates
entry inproject-proxy-acme-chief
Hiera. By convention, custom domains have certificates with names starting withcustom
. Note that you will need to setchallenge: http-01
, and all possible domain names will need to be added one by one as wildcard certificates are not supported. - Run Puppet on the active project-proxy acme-chief host.
- Add the zone to
profile::wmcs::novaproxy::supported_zones
in theproxy
Hiera prefix. Leaveid
(the designate zone ID) as empty, and setapex: true
if using the configured root domain for a proxy is wanted.
Expose real visitor IPs to a proxied service
The default behavior of novaproxy is to hide the actual user's IP address from a proxied service. This helps protect end-user privacy and also reduces the risk of a Cloud VPS project accidentally leaking private information. There are however use cases that really need the visitor's apparent IP to be exposed. Generally this is used for some form of vandal or content harvesting protection.
To expose visitor IP addresses to a backend service, add the webproxy name (for example utrs.wmflabs.org) to the list of proxies in the profile::wmcs::novaproxy::xff_fqdns
Project Puppet hiera setting via Horizon. This will configure the proxy to send the IP it sees for the user in an X-Forwared-For
header attached to each request.