From 58c44db08a040de75cf878588af9c573083e0b84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pesti=20Tam=C3=A1s?= <pesti.tamas@hallgato.ppke.hu>
Date: Tue, 14 May 2024 17:41:04 +0200
Subject: [PATCH] Fix nginx not using correct domains

---
 backend/run_in_docker.sh  | 2 +-
 frontend/run_in_docker.sh | 2 +-
 nginx/nginx.conf          | 4 ++--
 nginx/run_in_docker.sh    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/backend/run_in_docker.sh b/backend/run_in_docker.sh
index 514027c..e4e181d 100755
--- a/backend/run_in_docker.sh
+++ b/backend/run_in_docker.sh
@@ -9,7 +9,7 @@ sudo docker run \
 	-w /app \
 	-p 8080:8080 \
 	-u $(id -u):$(id -g) \
-	--name szofttech_webapp_backend \
+	--name szofttech-webapp-backend \
 	--network szofttech_webapp_network \
 	eclipse-temurin:21-jdk \
 	./mvnw spring-boot:run
diff --git a/frontend/run_in_docker.sh b/frontend/run_in_docker.sh
index fa89c97..ed28585 100755
--- a/frontend/run_in_docker.sh
+++ b/frontend/run_in_docker.sh
@@ -9,7 +9,7 @@ sudo docker run \
 	-u $(id -u):$(id -g) \
 	-p 3000:3000 \
 	-w /app \
-	--name szofttech_webapp_frontend \
+	--name szofttech-webapp-frontend \
 	--network szofttech_webapp_network \
 	node:latest \
 	./start.sh
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 28bd238..382b53f 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -18,14 +18,14 @@ http {
         # backend
 		location /api {
 			# rewrite /api/(.*) /$1  break;
-			proxy_pass http://szofttech_webapp_backend:8080;
+			proxy_pass http://szofttech-webapp-backend:8080;
 		}
 
 		# otherwise fallback to frontend
 		location / {
 			client_max_body_size 100M;
             # rewrite ^/static/(.*)$ /$1 break;
-			proxy_pass http://szofttech_webapp_frontend:3000;
+			proxy_pass http://szofttech-webapp-frontend:3000;
 			proxy_set_header Host			$host;
 			proxy_set_header X-Real-IP $remote_addr;
 			proxy_set_header X-Forwarded-Proto $scheme;
diff --git a/nginx/run_in_docker.sh b/nginx/run_in_docker.sh
index 16d3bfb..473479d 100755
--- a/nginx/run_in_docker.sh
+++ b/nginx/run_in_docker.sh
@@ -4,6 +4,6 @@ sudo docker run \
 	--rm \
 	-v "$(pwd)/nginx/nginx.conf":/etc/nginx/nginx.conf \
 	-p 80:80 \
-	--name szofttech_webapp_nginx \
+	--name szofttech-webapp-nginx \
 	--network szofttech_webapp_network \
 	nginx:latest
-- 
GitLab