Web → Reverse proxies

A reverse proxy publishes a web service behind the appliance with a public name: the appliance’s web server answers on ports 80 and 443, tells the sites…

A reverse proxy publishes a web service behind the appliance with a public name: the appliance’s web server answers on ports 80 and 443, tells the sites apart by the requested name, terminates TLS with the site’s certificate and forwards the request to the internal service. The internal service never sees the internet directly and can stay in plain http.

You need it when:

  • you have one or more internal websites or web applications (a business application, a company site, an interface of a device) to reach from outside with a valid name and certificate;
  • you want several sites on the same port 443, told apart by name;
  • you do not want to manage the certificate on every internal server.

It is not for publishing services that are not web (SSH, VoIP): those are published on the router or on Argos with a port publication.

For the technician Each proxy is a site (vhost) in the nginx configuration, in the web server’s container. The file starts with the header # Edon Nginx Reverse Proxy: <name> and that is what lets the console recognize and re-read it. An operation on the proxy applies the nginx configuration: it reloads, and if it cannot signal the main process it restarts the container. This is why the console runs it in the background (see “What happens when you save”).

Before creating a proxy

  • The public name (for example erp.johnsmith.test) must point, in the public DNS, to the appliance’s public address (atlas.johnsmith.test is 198.51.100.40). For Let’s Encrypt this is essential, and it holds for every name you add.
  • Ports 80 and 443 of the public address must reach the appliance. If Argos or a router is in front, they must forward them: see the chapter “Publishing a server” of the Argos manual. Let’s Encrypt verifies the name on port 80.
  • The internal service must answer the appliance (for example http://192.168.10.41:8080).
  • To use Let’s Encrypt you must have enabled it once for the whole appliance, in System → Settings → TLS certificates (see “Enabling Let’s Encrypt” below). Until you do, the «TLS mode» field offers only «Self-signed».

The list

The bar shows «Reverse proxies» and these icons:

Icon (description) What it does
«Settings» opens System → Settings → TLS certificates
«Show system proxies» / «Hide system proxies» shows or hides the sites written by Atlas and by modules (see below); in brackets it says how many are hidden. The choice is remembered
«Refresh» re-reads the list
«Add proxy» opens the form for a new proxy

The search filters by proxy name, public names and internal service. Each row shows:

  • the name in bold;
  • on the right, a label with the TLS mode («Let’s Encrypt» or «Self-signed») and, for the sites the console does not let you change, a label with a padlock («Atlas», «Module» or «Leftover»);
  • the public names;
  • the internal service.

With no proxy selected, on the right you see a short introduction («Publish internal services to the outside through the built-in reverse proxy, with TLS handled for you.»). If the web server is not yet configured the page says «The nginx reverse proxy is not configured yet. Complete the setup first.»

The reverse proxies listThe reverse proxies list
The reverse proxies list

The sites you cannot change from here

The list also shows the sites written by the appliance. They are read-only: in the detail you see the names, the destination, an explanation and, where it exists, the «Open the page that manages it» link. The «Remove» button is disabled and its description says why.

Label Site Where it is managed
«Atlas» the console itself (root of port 443) it is not managed: Atlas writes it at installation and its updates rewrite it
«Module» the mail server on the appliance’s internet name, with webmail, calendars and the paths of single sign-on, the softphone and AI access System → Settings → Hosts (the name is changed there)
«Module» the automatic configuration of mail programs (autoconfig and autodiscover for every domain) Mail → Domains: it changes by adding or removing a domain
«Module» the Git server System → Settings (Git block)
«Module» the newsletter System → Settings (Newsletter block)
«Leftover» sites left by earlier versions (the old softphone site, the first VPN sites) no longer needed: Atlas removes them by itself at the update

The «Atlas», mail and autoconfiguration sites are hidden until you press «Show system proxies».

Warning Do not try to replace these sites with a proxy of your own: the names atlas, auto, pbx, roadwarrior, default and all those that start with edon- are reserved. If you try, the «Name» field says «Name reserved for the sites of Atlas and the modules (atlas, auto, pbx, roadwarrior, default, edon-…)».

A proxy’s form

The «Add proxy» button opens the «Add reverse proxy» form; selecting an existing proxy opens «Edit reverse proxy». The form has three blocks.

First block (untitled): the site

Field What it means Typical value
«Name» the site’s identifier: letters, digits, dot, hyphen and underscore, starting with a letter or a digit. It cannot be changed after creation erp
«Domains» the public names served by the proxy. Write a name and press «Add»; each name has a «Remove» button. The empty list says «No domains yet.». The first name gives the certificate its name erp.johnsmith.test
«Destination» where the proxy forwards requests. http://10.20.0.5:8080 or just 10.20.0.5:8080 (the http:// is added by itself). It can be an IPv4 address or a host name, which must resolve; the port goes from 1 to 65535 http://192.168.10.41:8080

«TLS» block

Field What it means Typical value
«TLS mode» «Let’s Encrypt» (only if enabled for the appliance) or «Self-signed». A new proxy starts as «Self-signed». The “HTTP only” mode is no longer offered: every proxy has HTTPS and port 80 redirects to https «Let’s Encrypt»

With «Let’s Encrypt» the public DNS must point the names to the appliance. With «Self-signed» the site is served with a certificate browsers do not know: fine for internal use where you can install the CA, not for the public. An old proxy that was HTTP-only shows the «None (HTTP only)» label and, at the first save, becomes «Self-signed».

«Options» block

Field What it means Default
«Preserve Host header» forwards to the internal service the Host header the visitor sent, that is, the public name. Off, the service sees its own address on
«WebSocket» passes Upgrade/Connection for real-time applications off
«Max body size» maximum size of a request: a number, with k, m or g (100m, 2g); 0 removes the limit (not recommended). Empty: 1 MB empty
«Extra directives» raw nginx directives, one per line, inserted in the location block (for example proxy_read_timeout 300s;) empty

At the bottom of the form, the «Add» button (new proxy) or «Save» (existing proxy); with changes in progress «Reset» also appears, which returns the fields to the saved values.

Warning The «Extra directives» end up in the nginx configuration with no check other than nginx’s own. A wrong directive is refused by nginx (you read «Nginx rejected the configuration.» in the bell) and the proxy does not change; but a directive that is valid and wrong in substance, for example one that bypasses authentication, works.

What happens when you save

Saving is not immediate. After you press «Add» or «Save»:

  1. the console checks the fields and, if something is wrong, marks it under the field (see “Error messages”);
  2. if everything is fine, the page is covered with the text «Applying the proxy configuration… Do not close this page.» and the operation continues in the background;
  3. with «Let’s Encrypt», first of all the certificate is requested (or extended, if you add a name to a proxy that already has one): it can take up to a few minutes. If the request fails the proxy is neither created nor changed;
  4. then the site is written and nginx reloaded;
  5. at the end the page re-reads and the outcome arrives in the notifications bell: «Proxy configured» or «Proxy configuration failed» (with the reason).

One operation at a time: if another starts while one is in progress, the save says «Another reverse proxy operation is already running. Wait for it to finish and try again.»

When you move a proxy from «Let’s Encrypt» to «Self-signed», or change its first domain, the old Let’s Encrypt certificate is deleted if no other site, the mail server or the VPN still uses it: this way no failing renewal is left for a name that no longer points here.

Removing a proxy

With the proxy selected, the «Remove» icon in the detail bar asks for confirmation («Remove this reverse proxy? <name>»). This too is a background operation, and here too the outcome arrives in the bell («Proxy removed» or «Proxy removal failed»). The proxy’s Let’s Encrypt certificate is deleted only if no one else uses it. Up to version 1.3.6~deb113 this did not happen, and the certificates of removed proxies stayed behind, renewing: with the next update an appliance with the Mail module deletes, once, those that no site, the mail server or the VPN uses any more.

Enabling Let’s Encrypt (System → Settings → TLS certificates)

The block gives consent, once per appliance, to issue public certificates:

Field What it means Typical value
«Enable Let’s Encrypt» allows issuing trusted certificates with the ACME protocol. Requires public DNS for the names and port 80 inbound. It cannot be turned off while a reverse proxy uses it: the field says so and names the proxies; convert them to «Self-signed» first on
«Contact email» registered with Let’s Encrypt for the ACME account and expiry notices. By turning the service on you accept Let’s Encrypt’s terms (the block shows their address) it@johnsmith.test

The button is «Apply». With the Mail module installed, activation immediately issues the certificate of the appliance’s internet name; without mail the appliance has no internet name yet (it gets one with the Mail module), the switch reads «Enable Let’s Encrypt for the reverse proxies» and nothing is issued: proxies request their certificates when you create them. Once Mail is installed, «Apply» also requests the certificate for the appliance’s name. The operation lasts about a minute, with the page covered by «Issuing the Let’s Encrypt certificate… Do not close this page.»; changing only the email shows «Updating the Let’s Encrypt contact address… Do not close this page.» and turning it off «Deleting the Let’s Encrypt certificate and restoring self-signed ones… Do not close this page.».

Example: publishing the business application with Let’s Encrypt

Situation. John Smith Ltd has a business application on server 192.168.10.41, port 8080 over http. The sales reps also use it from outside the office and want an address with the padlock: erp.johnsmith.test.

What you need. The A record erp.johnsmith.test → 198.51.100.40 in the public DNS; ports 80 and 443 of that address forwarded to the appliance; Let’s Encrypt enabled.

Steps.

  1. In System → Settings → TLS certificates turn on «Enable Let’s Encrypt», write it@johnsmith.test in «Contact email» and press «Apply». Wait for the operation to finish.
  2. Open Web → Reverse proxies and press «Add proxy».
  3. «Name»: erp.
  4. «Domains»: write erp.johnsmith.test and press «Add».
  5. «Destination»: 192.168.10.41:8080.
  6. «TLS mode»: «Let’s Encrypt».
  7. «Max body size»: 50m (the sales reps attach documents).
  8. Press «Add» and let the page finish (up to a few minutes).

Check. In the bell «Proxy configured» appears; in the list the erp row has the «Let’s Encrypt» label. From a phone on the mobile network https://erp.johnsmith.test/ opens with the padlock, and http://erp.johnsmith.test/ leads to https.

If something goes wrong. «Proxy configuration failed» with the detail erp.johnsmith.test: certificate issuance failed (check public DNS and inbound port 80): Let’s Encrypt did not reach the name. Check the A record and port 80 from outside, then press «Save» again. The proxy was not created: there is nothing to clean up.

Example: a site with two names

Situation. The company site is on server 192.168.10.40 (port 80, http). It must answer both www.johnsmith.test and johnsmith.test, with a single certificate.

Steps.

  1. Web → Reverse proxies, «Add proxy».
  2. «Name»: website.
  3. «Domains»: add www.johnsmith.test and then johnsmith.test. The first gives the certificate its name, the other is an additional name in the same certificate.
  4. «Destination»: http://192.168.10.40.
  5. «TLS mode»: «Let’s Encrypt».
  6. Leave the options as they are (Host header preserved) and press «Add».

Check. Both names open in https with the same certificate. In the proxy’s detail the two names appear in the «Domains» list.

If something goes wrong. If for one of the two names the DNS does not point to the appliance, Let’s Encrypt refuses the whole certificate: fix the DNS or remove the name from the list.

Example: adding a name to a proxy that already exists

Situation. The website proxy must also answer shop.johnsmith.test.

Steps.

  1. Select website in the list.
  2. In «Domains» write shop.johnsmith.test and press «Add».
  3. Press «Save».

What happens. The existing certificate does not cover the new name, so the console extends it before writing the site: the old names keep working. Mind the first name in the list: it is the one that gives the certificate its name. If you change the first name, the certificate changes name and the old one is deleted when no other site uses it. Add new names at the end, unless you really want to change the main name.

Example: going back from the public certificate to the self-signed one

Situation. The intranet proxy (intranet.johnsmith.test) is reachable only from the LAN and you no longer want to request a public certificate.

Steps.

  1. Select intranet.
  2. «TLS mode»: «Self-signed».
  3. Press «Save».

Check. The list row changes to «Self-signed». The proxy’s Let’s Encrypt certificate is deleted, unless others use it. Now in the «TLS certificates» block the name of intranet is no longer among those that prevent turning Let’s Encrypt off.

Error messages

Message Meaning
«Required field» name, domains or destination missing
«Only letters, digits, dot, hyphen and underscore, starting with a letter or a digit» invalid «Name»
«A proxy with this name already exists» name already used
«The upstream host name does not resolve: check the name and the port (e.g. 192.168.1.20:8080)» «Destination» with a name that does not exist or a port out of range
«This site belongs to Atlas: it cannot be edited or removed here» name of an appliance site
«This site is published by a module and is managed from its page» the same, for a module
«Invalid domain name» a name in «Domains» is not a valid host name
«<name> is already served by the site <site>» that name already belongs to another site (even to a VPN step): nginx would answer with only one of the two
«Invalid upstream target» the «Destination» is not http(s)://host[:port]
«The upstream cannot be this appliance: through the proxy, the console would take internet visitors for local ones» the destination is the appliance itself (127.0.0.1, localhost, one of its addresses, or a name that resolves to them)
«Use a number, optionally followed by k, m or g (e.g. 100m); 0 lifts the limit» invalid «Max body size»
«Let’s Encrypt is disabled (enable it in Settings → TLS certificates)» you chose Let’s Encrypt without having enabled it

For the technician The console refuses to answer any request that has passed through an appliance reverse proxy: every proxy adds the X-Atlas-Reverse-Proxy header and the console answers 403. This way a proxy that pointed (even through a name that changes later) at the appliance itself does not turn an internet visitor into a LAN client, with password login without SSO and the MCP gateway reserved to the trusted network.

Limits and pitfalls

  • The page does not publish ports other than 80/443 or non-web protocols.
  • A proxy’s name cannot be changed: to rename it, create the new one and remove the old one.
  • From inside, with the public name, the LAN’s PCs follow the DNS they use. If you want them to reach the appliance directly, in the internal DNS (see DNS) the name must resolve to the appliance’s internal address; if it resolves to the public address, the path depends on how the router (or Argos) handles the return to the LAN.
  • Adding or removing a proxy reconfigures the web server: for a few seconds the open connections on the sites may drop.
  • A Let’s Encrypt certificate renews by itself; if the name stops pointing to the appliance, renewals fail and the contact address receives the expiry notices.
LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer