Skip to content
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

Disable HTTPS #51

Open
paambaati opened this issue Jun 16, 2022 · 4 comments
Open

Disable HTTPS #51

paambaati opened this issue Jun 16, 2022 · 4 comments
Labels
question Further information is requested

Comments

@paambaati
Copy link

I use this module (and not ecs-fargate, as I could not understand the difference between the two), but I am able to successfully provision a cluster with tasks. However, I'm trying to disable HTTPS (i.s. remove listeners/target groups on 443) and have only 1 custom port (non-SSL) defined on the container that will be serving up health check responses, and I see no option to do this.

How does one disable all HTTPS with this module?

@jnonino jnonino added the question Further information is requested label Jun 22, 2022
@okanaiki
Copy link

okanaiki commented Jul 3, 2022

Listener could be disabled with lb_https_ports = {}

But main question is how to setup health checks on target group to protocol HTTP different from lb listener (not HTTPS)
It's a standard flow 443 HTTPS on LB listener >> 80 HTTP on targets (health check on target groups should be set up to 80 HTTP)

There is an target_group_health_check... but no protocol variable among them so only HTTPS now can be used

Variable HealthCheckProtocol from documentation

https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_ModifyTargetGroup.html

will solve this.

@nijine
Copy link

nijine commented Jan 28, 2023

Ran into a similar issue where I just want to serve HTTP requests on the app end and have the LB deal with serving SSL. I was going nuts trying to understand why the service kept going down, and it was because nothing was being served on port 443 (it's not the usual way of doing it).

This is traditionally done with an HTTP listener that redirects requests to an HTTPS listener, and then the HTTPS listener points to the target group that talks to the service on HTTP.

There should be an option here to just redirect from HTTP listener -> HTTPS listener in this case, which is probably pretty common.

@nijine
Copy link

nijine commented Jan 28, 2023

I came up with a workaround to get the behavior that I mentioned above, which effectively eliminates the HTTPS target group but still serves an HTTPS page using an HTTP-only app.

lb_http_ports = { "default_http": { "listener_port": 80, "host": "#{host}", "path": "/#{path}", "protocol": "HTTPS", "query": "#{query}", "port": 443, "type": "redirect" } }

lb_https_ports = { "default_http": { "listener_port": 443, "target_group_port": 80, "target_group_protocol": "HTTP", "type": "forward" } }

@jnonino
Copy link
Member

jnonino commented Feb 7, 2023

Hi everyone, how are you?
Thanks for discussing and finding solutions for it, please feel free to raise all the PR that you consider necessary, contributions are always welcome, and I try to approve and release the changes as soon as they come!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

4 participants