# Java AdminConnection doesn't work with Stardog behind a reverse proxy

**URL:** https://community.stardog.com/t/java-adminconnection-doesnt-work-with-stardog-behind-a-reverse-proxy/5072
**Category:** Bug
**Created:** [September 10, 2024, 1:09am UTC](https://community.stardog.com/t/java-adminconnection-doesnt-work-with-stardog-behind-a-reverse-proxy/5072 "2024-09-10T01:09:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shaun](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@shaun](https://community.stardog.com/u/shaun)
#### Post date: [September 10, 2024, 1:09am UTC](https://community.stardog.com/t/java-adminconnection-doesnt-work-with-stardog-behind-a-reverse-proxy/5072/1 "2024-09-10T01:09:38Z")

</div>

We have Stardog running inside a k8s cluster and behind a nginx reverse proxy

> **[hostname.com - This website is for sale! - hostname...](http://k8s.hostname.com/stardog)**
>
> This website is for sale! hostname.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, hostname.com has it all. We hope you find what you are searching...

If we use raw HTTP connections in python or Java we can access the admin functions like list databases for example.

However if we use the stardog java library to create an admin connection and list the databases (or anything else) it fails because it strips the path component when constructing the HttpAdminClientImpl.

For example our connection string is [https://k8s.hostname.com:5820/stardog](https://k8s.hostname.com:5820/stardog) which it should add 'admin/databases' to, instead it extracts the scheme (https), the host([k8s.hostname.com](http://k8s.hostname.com)), the port (5820) and uses them to construct a new URL [https://k8s.hostname.com:5820/admin/databases](https://k8s.hostname.com:5820/admin/databases) instead of [https://k8s.hostname.com:5820/stardog/admin/databases](https://k8s.hostname.com:5820/stardog/admin/databases)

---

<div class="post-metadata">

### Author: ![shaun](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@shaun](https://community.stardog.com/u/shaun)
#### Post date: [September 10, 2024, 2:02am UTC](https://community.stardog.com/t/java-adminconnection-doesnt-work-with-stardog-behind-a-reverse-proxy/5072/2 "2024-09-10T02:02:27Z")

</div>

As a work-around we've implemented another rewrite rule in the reverse proxy that forwards /admin/\* to the stardog pod in the same way we forward /stardog prefixed paths to the stardog pod except we don;t need to remove the stardog path
