Web-UI - Reverse proxy support (traefik)

Context
I’m running duplicacy web in a docker container (thanks to saspus/duplicacy-web :)).
As a best practice I try to put all my web gui containers behind a traefik reverse proxy (also running in a container).
I have duplicacy running on my docker host served via traefik on sub-path /duplicacy
These are the traefik rules I have in my docker-compose:

traefik.rule1.frontend.rule=PathPrefixStrip:/duplicacy/
traefik.rule2.frontend.rule=PathPrefix:/verify_password,/get_backup_status,/get_schedule_status,/list_repositories,/list_revisions,/add_job,/delete_repository,/lookup_schedule,/save_schedule,/get_patterns,/save_patterns,/save_repository,/start_stop_backup,/get_schedule_email,/set_schedule_email,/test_schedule_email,/delete_schedule,/list_files,/get_listing_status,/update_listing_session,/list_restore_directory,/list_local_directory,/start_restore,/get_restore_status,/show_log

The first rule is what I typically need to put, basically telling traefik to forward http://docker-host/duplicacy/ toward the duplicacy container.
I had to add the second rule to make the duplicacy web gui function properly. This is because those functions are being called from within the duplicacy web gui and they are not including the /duplicacy/ sub path.

Requested feature
I’m not a web developer so I don’t know the correct technical way to ask this :slight_smile: Ideally the web gui should take into account the headers it is getting from the reverse proxy to realize it is running under a /duplicacy/ subpath. Enabling me to get rid of that second rule.

Thanks!

1 Like

I can add an optional url prefix that can be set in the duplicacy.json file. This should be a easy change.

4 Likes

Cool :slight_smile: I will happily try it out. :+1:

This is great. I need it for the same reason, and pretty much the same scenario.

Would be great to also expose it as an environment variable for docker (so I can set it in a docker-compose).

Was this ever implemented?

I don’t see a place to configure this in the Settings page, but maybe it’s only altered in the settings.json?
Ah, I see that it would be set in duplicacy.json, but I haven’t seen anywhere what the key would be.

Thanks.

I’m using duplicacy w/ traefik, and the stripprefix rule is working well for me, without that “PathPrefix” rule in the OP. Seems like the urls are all properly relative, so they include the prefix automatically. Thank you! :slight_smile: Seems like a lot of apps struggle with this, so kudos!

1 Like

… Just kidding, it seems that some pages don’t work, e.g. the restore page.