Can I reverse-proxy the server into a sub-location?

I would like to reverse-proxy the server component into a sub-location, e.g. https://example.com/atuin

The client config would then be:

sync_address = "https://example.com/atuin"

Is this possible or will this confuse the server? I haven’t checked the code yet, thus I am just trying to satisfy my curiosity. And I suspect that devs are in this forum. :wink:

This works. I’m currently using it. You need to set path = "/atuin" on the server.

1 Like

Thanks, I will give it a try. First I’ll have to setup Postgres. Shouldn’t take long, but I’m rather busy this weekend. Too many plans already. :wink:

I will report back when all is setup and post my reverse-proxy config (Apache) and my systemd file for reference. (I will use a service user, thus I’ll have to use env vars.)

Setting path = "/atuin does not work. I actually had to remove it.

Here are my Apache directives:

    ProxyPass /atuin http://localhost:8888
    ProxyPassReverse /atuin http://localhost:8888

This is my /etc/systemd/system/atuin.service:

[Unit]
Description=atuin
After=network.target postgresql.service
Requires=postgresql.service

[Service]
Type=simple
User=atuin
Group=atuin
EnvironmentFile=/etc/atuin/atuin.cfg
WorkingDirectory=/etc/atuin
Environment=HOME="/etc/atuin"
ExecStart=/usr/sbin/atuin server start
StandardOutput=append:/var/log/atuin/atuin.log
StandardError=append:/var/log/atuin/atuin.log
Restart=on-failure
RestartSec=3
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

And here’s the /etc/atuin/atuin.cfg:

ATUIN_HOST="127.0.0.1"
ATUIN_PORT=8888
ATUIN_OPEN_REGISTRATION=true
ATUIN_DB_URI="postgres://atuin:passwordhere@127.0.0.1/atuin"

With this everything works splendidly.

1 Like