Issue with sqlAdmin under https domain and path
03:51 16 Nov 2025

Let me start from middle. I have been play around for a long time with these three part:

  1. nginx which handles the path
  2. Fastapi server
  3. sqlAdmin

The url https://example.com/gem/admin must be passed to sqlAdmin but there is this agonizing contrast. If nginx configs like:

location /gem/admin/ {
    proxy_pass http://172.18.0.18:80/;

and sqlAdmin like:

admin = Admin(
    application, 
    engine, 
    authentication_backend=authentication_backend,
    base_url="/admin",
    title="Gem Admin Panel"
)

request will not be passed to sqlAdmin and be served by FastApi like

{"detail":"Not Found"}

If I remove base_url then the styles url would be wrong like (missing admin):

https://example.com/gem/statics/css/fontawesome.min.css

If I remove trailing slash from nginx location and proxypass then it will add another admin to url resulting to 404 error.

it is frustrainting really. Please help me out.

nginx fastapi