New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to bind multi-domain with different router, ssl, and proxies? #1135

UnionMexicanaDelNorte opened this Issue Nov 13, 2018 · 0 comments


None yet
1 participant

UnionMexicanaDelNorte commented Nov 13, 2018

Hi guys.

First of all, congratulations for the web framework, is great.

I have 4 domains, and I need a different router for each domain.

I need it to work with ssl, and port 80 redirect to the secure address. I based on: #482 for the multidomain, and in: to redirect port 80, however, multidomain works well with ssl, but port 80 always redirects to the same domain, that is: works fine works fine works fine works fine works fine redirect to, must redirect to redirect to, must redirect to redirect to, must redirect to

here my code:

defSubdomain2:= app.Party("two.")
   defSubdomain2.Get("/", func(ctx iris.Context) {

defSubdomain3:= app.Party("three.")
   defSubdomain3.Get("/", func(ctx iris.Context) {

defSubdomain4:= app.Party("four.")
   defSubdomain4.Get("/", func(ctx iris.Context) {

target, _ := url.Parse("")
go host.NewProxy("one:80", target).ListenAndServe()

targetTWO, _ := url.Parse("")
targetTHREE, _ := url.Parse("")
targetFOUR, _ := url.Parse("")
go host.NewProxy("", targetTWO).ListenAndServe()
go host.NewProxy("", targetTHREE).ListenAndServe()
go host.NewProxy("", targetFOUR).ListenAndServe()

appConf := iris.Configuration{
	DisablePathCorrection: true,

app.Run(iris.TLS(":443", "somefile.pem", "otherfile.pem"), iris.WithConfiguration(appConf))

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment