TLJH configuration behind Apache

I’m trying to set up TLJH as a folder on an existing webserver. My desired behavior is the following:

I’ve tried configuring TLJH through tljh-config to no avail. At the moment, I have Apache accepting traffic over port 80. site1 is working fine, but when I try to go to, I get redirect to and get a 404 error.

The output of tljh-config show is:

  - hcchem3d
  default_app: jupyterlab
  port: 8080
  port: 8443
    hub_prefix: jhub
    bind_url: http://:15001/jupyter/

My Apache configuration for Jupiter is:

<VirtualHost *:80>

	RedirectMatch ^/jupyter(()|/)$ /jupyter/
	ProxyRequests on
	<Location "/jupyter/">
		# Preserve Host header to avoid cross-origin problems
		ProxyPreserveHost on
		# Proxy to JupyterHub
		ProxyPass  http://localhost:8080/jupyter/
		ProxyPassReverse http://localhost:8080/jupyter/

I can’t figure out where the redirection is occurring from /jupyter -> /hub/jupyter/. None of the instructions for base installs of JupyterHub are helping, I assume because Traefik is doing some work in the middle of this process. Is there a way to get this to work within the TLJH ecosystem?

I’ve given up on configuring Apache as the web-facing configuration. Now, I have Apache set to listen on port 8080. I configured the rules.toml file with the following

backend = "backend__2F"
passHostHeader = true
priority = 100
rule = "Path:/;AddPrefix:/hub"
data = "{\"hub\": true}"

backend = "backend__2F"
passHostHeader = true
priority = 90
rule = "PathPrefix:/hub"

backend = "webmo"
passHostHeader = true
priority = 80
rule = "PathPrefix:/webmo"

url = ""

url = "http://localhost:8080"

Using this, I’m able to navigate to the WebMO login page, but only if I explicitly type the port in the address bar… which means I have to open port 8080 in the Google Cloud firewall. What am I missing in this setup to push to automatically redirect to port 8080?

The output of wget localhost/webmo is

--2020-03-31 20:00:02--  http://localhost/webmo
Resolving localhost (localhost)...
Connecting to localhost (localhost)||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/~webmo/cgi-bin/webmo/login.cgi [following]
--2020-03-31 20:00:02--  http://localhost/~webmo/cgi-bin/webmo/login.cgi
Reusing existing connection to localhost:80.
HTTP request sent, awaiting response... 404 Not Found
2020-03-31 20:00:02 ERROR 404: Not Found.

Changing it to wget localhost:8080/webmo results in

--2020-03-31 20:00:10--  http://localhost:8080/webmo
Resolving localhost (localhost)...
Connecting to localhost (localhost)||:8080... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost:8080/~webmo/cgi-bin/webmo/login.cgi [following]
--2020-03-31 20:00:10--  http://localhost:8080/~webmo/cgi-bin/webmo/login.cgi
Reusing existing connection to localhost:8080.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
webmo: Permission denied

This is fine, as the login page wants a username and password.

Additionally, every time I reload TLJH, the rules.toml file is rewritten… how do I add my modifications to the configuration for this file?

To summarize: how can I automate the Traefik redirection of localhost/webmo to localhost:8080/webmo, and how can I configure changes to the file rules.toml?