These are chat archives for gin-gonic/gin

4th
Feb 2016
Depado
@Depado
Feb 04 2016 16:50
Hey guys, any guide on how to handle subdomains using Gin ? :)
By the way I wrote an article on embedding resources using rice.go in a gin project :) http://depado.markdownblog.com/2016-01-29-embedding-resources-with-rice-go-in-a-gin-project
Craig Peterson
@captncraig
Feb 04 2016 16:53
@Depado you should be able to get the host from context.Request.Host
you’d have to parse the subdomain out yourself though I’m afraid
I don’t think you can route on it or anything
unless I’m mistaken
Depado
@Depado
Feb 04 2016 16:54
I guess that will cause problems if it runs behind a reverse proxy ? Well I'll look into that later then, will wait to be at home to do some tests ._.
Thanks @captncraig
Craig Peterson
@captncraig
Feb 04 2016 16:56
yeah, you need to make sure your proxy preserves the host header
Depado
@Depado
Feb 04 2016 16:57
Got it ^^ Thanks :)
Craig Peterson
@captncraig
Feb 04 2016 16:57
with caddy you can do proxy_header Host {{host}}