Hi Caddy community,
Thanks for the active Caddy project. I asked a question on the golang nuts mailing list two days back for a problem and was recommended Caddy as a solution by someone there. I would like to explain my need and better understand if Caddy will be a good solution for me. I will be thankful if any of you can read through and explain if I will be in the right direction with Caddy.
I have written a bunch of HTTP handlers. As of now, I have written a main program that uses all the Handlers in a HTTP mux, for different paths and deploy these handlers as a single Go binary. All these handlers talk REST and also does CORS handling (has code like below):
res.Header().Set(“Access-Control-Allow-Origin”, conf.CORS_ORIGIN)
res.Header().Set(“Access-Control-Allow-Methods”, “POST,OPTIONS”)
res.Header().Set(“Access-Control-Allow-Headers”, “Authorization”)
res.Header().Set(“Access-Control-Allow-Credentials”, “true”)
One of the HTTP handlers is a login
handler which will take an username and password and will give out a JWT. This JWT will be used for authentication in the further handlers. I have written a React webapp that will talk to this monolithic Golang server.
I have purchased a domain name too (let us call it example.com for now). Now, I want to deploy the Golang server under: https://api.example.com and the react webapp under https://www.example.com
Even though the Golang server is monolithic as of now, in future, I may be splitting the handlers into their own binaries and then launch multiple processes. Also, I may want to use something like Kubernetes in future, to scale these individual services differently (like only one node for the login service whereas the core-search service may need at least 4 nodes, etc.).
As I have mentioned the current state of the project and the future direction, I would like to seek your opinion on, if Caddy would be a good tool for me to use here. My only constraints are:
- HTTPS Enforcement (Potentially by talking to letsencrypt)
- Ability to work with kubernetes (In future)
Are there any good tutorials or talks or videos or blogposts where this process (Deploying a Golang HTTP server via caddy on the web, with certificates from letsencrypt) is explained / taught ? I did try Googling and searching in youtube before asking here, but could not find much resources. Any help on this will be appreciated. Thanks.