Grist docker run on different url, nginx proxy

I want to run

authentik + grist behind an nginx reverse proxy.

Its an internal server, that does not have a hostname.
So what i would like todo is to host grist on:

server/grist

and authentik at:

server/authentik

which environment variable controls the url path grist runs on?

what i tried:

how i currently start the docker:

docker run -p 8484:8484 -e GRIST_SESSION_SECRET=invent-a-secret-here  \
  -v ~/grist:/persist \
  --name grist \
  --env DEBUG=1 \
  --env APP_DOC_INTERNAL_URL="http://localhost:8484/" \
  --env APP_DOC_URL="http://192.168.0.49/grist" \
  --env APP_STATIC_URL="http://192.168.0.49/grist" \
  --env APP_HOME_URL="http://192.168.0.49/grist" \
	gristlabs/grist

the relevant parts of the nginx config:

location /grist{
    proxy_pass http://127.0.0.1:8484/;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # WebSocket support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
}

The error i get:

Feb 24 16:07:24 grist bash[26957]: 2023-02-24 15:07:24.265 - debug: Redirecting anonymous user to: http://192.168.0.49/o/docs/

It tries to redirect the user to a url without /grist/
So instead of:
http://192.168.0.49/o/docs/
i want it to redirect (and serve):
http://192.168.0.49/grist/o/docs/

While writing this, i got the idea for an acceptable workaround, if the above is not possible.
I want grist to run behind nginx, because then i could cache certain items and also make a widget url.

But i do not really care where authentik runs, it could run on its default port :9000 or on another ip on the same server

Hi @enthus1ast, sorry, Grist can’t handle path prefixes yet. You’re not the first to ask though:

It wouldn’t be a particularly hard feature to add, but there’s often a work-around of some kind (like yours) so it hasn’t gotten priority.

Thank you paul, ill work around it then.