diff --git a/docker/beta/nginx.conf b/docker/beta/nginx.conf index 56e54da..174f576 100644 --- a/docker/beta/nginx.conf +++ b/docker/beta/nginx.conf @@ -35,14 +35,21 @@ http { server { server_name "shockrah.xyz"; + root /var/www/shockrah.xyz; + index index.html; + location / { - root /var/www/shockrah.xyz; + try_files $uri $uri/ /index.html; } } server { server_name "resume.shockrah.xyz"; + + root /var/www/resume.shockrah.xyz; + index index.html; + location / { - root /var/www/resume.shockrah.xyz; + try_files $uri $uri/ =404; } } } diff --git a/infra/load-balancer.tf b/infra/load-balancer.tf index 82324af..11c028d 100644 --- a/infra/load-balancer.tf +++ b/infra/load-balancer.tf @@ -31,6 +31,21 @@ resource "aws_lb_target_group" "shockrah_xyz" { } } +resource "aws_lb_listener" "http" { + load_balancer_arn = aws_lb.alpha.arn + port = 80 + protocol = "HTTP" + default_action { + type = "redirect" + + redirect { + port = 443 + protocol = "HTTPS" + status_code = "HTTP_301" + } + } +} + resource "aws_lb_listener" "https" { load_balancer_arn = aws_lb.alpha.arn port = 443