@oharahay
In that case, I think you cannot apply this solution.
Maybe you should try this.
Use Zecman's solution (/gps)
Build Traccar web using npm run build_release
with PUBLIC_URL=/gps/modern
See also README.md (https://github.com/traccar/traccar-web/tree/master/modern)
Apply newly built web frontend from the Step 2 on your traccar web folder (/opt/traccar/web)
I've never tried this myself but I think it's probably going to work.
In Step 3, you must back up the existing folder and overwrite the file appropriately.
I expect it to be applied as just overwriting files, restarting traccar, and remove caches your web browser, but in case you need to look at how Traccar Web works.
After all these years...
Today we have free SSL certs from multiple companies like LetsEncrypt. I do not see the need for subdirectory hosting any more. I switched to subdomain hosting like gps.my-domain.com
.
Then it is nothing more than a simple reverse proxy. Traccar has it's own subdomain and no rewrites are needed any more. Your subdirectory issue also would never happen.
If you are looking for a good webserver with easy reverse proxy features which also does all the certificate management on its own: Caddy Server
@dreamway
Thanks. this solution works. but i ran into a problem. I still have vaultwarden installed.
with this configuration, the /api path that belongs to vaultwarden gets into the rewrite rule and is passed to traccar.
causing vautwarden to stop working properly
can you tell me how to solve this problem?