LT behind reverse proxy and: LT_REQUIRE_API_KEY_ORIGIN

I have put LT behind a reverse proxy, enabled API keys and seem to have it all figured out except for LT_REQUIRE_API_KEY_ORIGIN

since I am behind a reverse proxy and thus have a fixed domain say translate.mydomain.tld I thought this parameter would somehow allow me to use the web interface of LT without api keys and thus only enforce api keys for api requests.

in the docker logs I can see that LT sees the request as coming from my reverse proxy’s internal docker IP:

libretranslate | 172.16.5.3 - - [03/Jan/2023 11:38:20] “GET /static/js/prism.min.js HTTP/1.1” 200 -

could someone please explain this parameter usage for me and how it is supposed to work?

I am confused as the documentation seems a bit lacking to me.

i.e. some docs are clear:

default is port 5000 and I can replace it with any I like

debugging is off and I can switch it to on with: true

and now to the unclear ones:

does this mean the default = 0?

is default: false?

is default: false and do I set it to true or to translate.mydomain.tld?

1 Like

No, the default means there are no limits. Setting it to 0 means that you always need an API key.

Yes.

translate.mydomain.tld.

Thanks. I just gave it a try and when visiting with a browser I am still asked for an API key.

in the docker logs I can see that LT sees the request as coming from my reverse proxy’s internal docker IP:

libretranslate | 172.16.5.3 - - [03/Jan/2023 11:38:20] “GET /static/js/prism.min.js HTTP/1.1” 200 -

Does anyone have this working behind a reverse proxy? What headers is LT looking at to check against LT_REQUIRE_API_KEY_ORIGIN ?

translate.mydomain.tld.

This seems wrong, setting it to https://translate.mydomain.tld worked for me. Weird.