I have a AWS ELB that maps traffic:
- from port 443 (https) to a EC2 instance on port 3000,
- from port 80 (http) to the same EC2 instance on port 80.
My goal is to have all traffic over https.
On that instance i have a node server listening on port 3000.
I tried to add a http server listening on port 80 to redirect all traffic but there is some permission problem and i also read that it's not a good practice to run a server using sudo command.
I tried to add a nginx configuration to the instance but it didn't work out.
server {
listen 80;
server_name app.elaisian.com;
location / {
proxy_pass https://app.sitename.com;
}
}
Thanks in advance