c0sogi / LLMChat

A full-stack Webui implementation of Large Language model, such as ChatGPT or LLaMA.
MIT License
245 stars 40 forks source link

using sub.domain.tld as HOST_MAIN #1

Closed Torhamilton closed 1 year ago

Torhamilton commented 1 year ago

Hi, I want to install this as production to a subdomain. Using sub.domain.tld as HOST_MAIN should work I am guessing? Thanks for this app, I will test and give my 2 cents of feedback.

c0sogi commented 1 year ago

Firstly, thank you for raising your first issue. By default, HOST_MAIN refers to the TLD, but it also works for subdomains (e.g. test.example.com). As also defined in the docker-compose-prod.yaml file, the traefik proxy will route to the api service for connections satisfying a Regex like HostRegexp(${HOST_MAIN},{subdomain:[a-z]+}.${HOST_MAIN},${HOST_IP}). If you use a subdomain as HOST_MAIN, a connection to port 80/443 will be routed to port 8000 as normal because it satisfies that Regexp. One more thing, HOST_MAIN is the address used to automatically get a TLS certificate from letsencrypt.

In conclusion, yes you can.

Torhamilton commented 1 year ago

Thanks for the fast response.