From 67fd1435b03f501a4430b19a5c47543f690812b4 Mon Sep 17 00:00:00 2001
From: Miguel Salerno <mans17@inf.ufpr.br>
Date: Wed, 13 Oct 2021 09:52:30 -0300
Subject: [PATCH] update nginx files

---
 nginx/caqvix   | 40 ++++++++++++++++++++++++++++++++++++++++
 nginx/labdados |  1 -
 nginx/simcaq   |  8 +++++---
 3 files changed, 45 insertions(+), 4 deletions(-)
 create mode 100644 nginx/caqvix

diff --git a/nginx/caqvix b/nginx/caqvix
new file mode 100644
index 0000000..f4a514a
--- /dev/null
+++ b/nginx/caqvix
@@ -0,0 +1,40 @@
+upstream caqvix {
+	  server localhost:5070 fail_timeout=0;
+}
+
+upstream api_server {
+    server localhost:3003 fail_timeout=0;
+}
+
+server {
+    listen 80;
+    server_name caqvix.c3sl.ufpr.br www.caqvix.c3sl.ufpr.br;
+    return 301 https://caqvix.c3sl.ufpr.br$request_uri;
+}
+
+server {
+    listen 443 ssl;
+    server_name caqvix.c3sl.ufpr.br www.caqvix.c3sl.ufpr.br;
+    ssl_certificate /etc/ssl/certs/c3sl.pem;
+    ssl_certificate_key /etc/ssl/private/c3sl.pem;
+
+    location / {
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection 'upgrade';
+        proxy_cache_bypass $http_upgrade;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_pass http://caqvix/;
+    }
+
+    location /api/ {
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection 'upgrade';
+        # proxy_set_header Host $host;
+        proxy_cache_bypass $http_upgrade;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_pass http://api_server;
+        proxy_read_timeout 600s;
+    }
+}
diff --git a/nginx/labdados b/nginx/labdados
index 2f37aee..49f04fe 100644
--- a/nginx/labdados
+++ b/nginx/labdados
@@ -54,4 +54,3 @@ server {
                 proxy_pass http://mapfor/;
         }
 }
-
diff --git a/nginx/simcaq b/nginx/simcaq
index e72a829..585468c 100644
--- a/nginx/simcaq
+++ b/nginx/simcaq
@@ -20,7 +20,8 @@ server {
         return 301 https://simcaqhom.c3sl.ufpr.br$request_uri;
 
 	# descomentar esses para rodar local (sem docker)
-	# root /home/simcaq/front-end/dist
+	# o nome da pasta foi renomeado
+	# root /home/simcaq/front-end-simcaq/dist
 	# index index.html index.htm;
 }
 
@@ -31,7 +32,8 @@ server {
         ssl_certificate_key /etc/ssl/private/c3sl.pem;
 
 	# descomentar esses para rodar local (sem docker)
-	# root /home/simcaq/front-end/dist;
+	# o nome da pasta foi renomeado
+	# root /home/simcaq/front-end-simcaq/dist;
 	# index index.html index.htm;
 
 	# comentar todo esse location para rodar local (sem docker)
@@ -65,7 +67,7 @@ server {
 #                proxy_pass http://node_server2;
 #                proxy_read_timeout 600s;
 #        }
-        
+
 #        location /doc {
 #                alias /home/simcaq/api-doc/build/;
 #        }
-- 
GitLab