Cannot access API from external URL in android mobile app

I have troubles accessing immich API from the android mobile app. Here is the relevant entry in my Caddyfile:
immich.domain.com {
tls internal {
on_demand
}
reverse_proxy immich_proxy:8080
}
immich.domain.com {
tls internal {
on_demand
}
reverse_proxy immich_proxy:8080
}
Here is the relevant .env line IMMICH_API_URL_EXTERNAL=https://immich.domain.com immich.domain.com/api/server-info/ping and my.docker.host.ip:2283/api/server-info/ping both gladly 😄 respond {"res":"pong"} What am I missing?
9 Replies
TastesLikeShit
TastesLikeShitOP•2y ago
When I use my.docker.host.ip:2283/api as the server endpoint URL in the android mobile app it works. I have a local DNS server and on my LAN I can ping https://immich.bb/api/server-info/ping which responds with {"res":"pong"} in a web browser. However, the Android mobile app says could not connect to server.
jrasm91
jrasm91•2y ago
Is it a self signed certificate?
jarelllama
jarelllama•2y ago
is the IMMICH_API_URL_EXTERNAL needed? I used Immich with Caddy before and didn't need that environment variable and my mobile app worked fine
jrasm91
jrasm91•2y ago
It is only needed if you host the API on a separate domain and machine than the web. Pretty much all, except the rare few (complicated) it is not needed. Most of the time it is used incorrectly.
jarelllama
jarelllama•2y ago
also @TastesLikeShit just checking that you're putting the /api in the app's server endpoint? i believe you can't just put in the subdomain alone
bo0tzz
bo0tzz•2y ago
That api url env var is wrong and you shouldn't need to set it at all If you put just the domain into the app, it will use that env var to figure out where the api is, if it's not set then it will use /api by default which is what you want
TastesLikeShit
TastesLikeShitOP•2y ago
self-signedfor local domains, I believe so. Which is why I need this in my caddyfile
tls internal {
on_demand
}
tls internal {
on_demand
}
but for external domain they arent self signed. I don't need it, everything on the same docker host 🙂 Okay I will try without the env var when I recover my pi 😅 I was uploading using the IP from app and pi died somehow, can't get it to boot again 😦 My guess is that when a video was uploaded (first) it started encoding, my pi was overclocked so either temp or voltage soft break or hard break something... 😬
TastesLikeShit
TastesLikeShitOP•2y ago
Would it be less ambiguous if we change the word "external" in the example.env and in docs to something more explicit to hint that it is only relevant when something is hosted on a separate machine?
jrasm91
jrasm91•2y ago
Self signed won't work with the mobile app

Did you find this page helpful?