Reputation: 3661
I am looking to enable https and redirect traffic from http to https on a server hosted on ec2.
I have achieved binding to port 4000 with https, but am having issues exposing this port for my instance to serve content from.
In my security groups I have the following configuration:
Incase it might be useful, the output of sudo docker ps
is:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
59315f7862f1 site_web "/site/entrypoint.sh …" 37 minutes ago Up 36 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:4000-4001- >4000-4001/tcp, 0.0.0.0:5432->5432/tcp site_1
I was thinking of looking down the route of using nginx to redirect traffic from 443 or iptables.
What direction should I look to solve this problem? Am I configuring this unconventionally?
Upvotes: 1
Views: 1170
Reputation: 791
Your security group as written allows tcp/443
from everywhere (IPv4 & IPv6), tcp/80
from everywhere (IPv4 & IPv6) and allows tcp/22
from the single IP 146.90.23.135
.
If your goal is to expose all of the docker ports listed you should remove both TCP 80
entries in your security group and add two new entries:
A few notes:
Type
column of the security group is really just to help input common protocols, it means nothing from a filtering/firewall standpoint. HTTP
is no different from a Custom TCP Rule
with the Port Range set to 80
.Upvotes: 1