From 5ce1bc4406cf9de9f398766c016879155cbeb69d Mon Sep 17 00:00:00 2001 From: skeris Date: Sun, 7 May 2023 14:52:43 +0300 Subject: [PATCH] fix default conf --- default.conf | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 2eba54f..448b5f5 100644 --- a/default.conf +++ b/default.conf @@ -3,13 +3,75 @@ server { index index.html index.htm index.nginx-debian.html; server_name _; # managed by Certbot - + + location /auth { + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type always; + return 200; + } + if ($host = admin.pena.digital) { + proxy_pass http://admin-auth-service:8080; + } + if ($host != admin.pena.digital) { + proxy_pass http://pena-auth-service:8080; + } + proxy_hide_header Access-Control-Allow-Origin; + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + } + location /user { + proxy_pass http://pena-auth-service:8080; + } + + location /swagger/ { + proxy_pass http://pena-auth-service:8080/; + } + location /cookie { + add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Credentials true; + add_header Set-Cookie "test=sameshit;SameSite=None;HttpOnly;Secure;"; + return 200; + } + + location /heruvym/ { + proxy_set_header Referer $host; + proxy_set_header Origin $http_origin; + proxy_set_header Connection ''; + proxy_http_version 1.1; + chunked_transfer_encoding off; + proxy_buffering off; + proxy_cache off; + proxy_pass https://10.6.0.11:1488/; + } + + location /strator/ { + proxy_pass http://hub-admin-backend-service:8005/; + } + location /feedback/ { + proxy_set_header Host $host; + proxy_pass http://10.6.0.31:8006/; + } + location / { if ($host = hub.pena.digital) { proxy_pass http://hub; } if ($host = docs.pena.digital) { proxy_pass http://docs; + } + if ($host = admin.pena.digital) { + proxy_pass http://admin; + } + if ($host = services.pena.digital) { + proxy_pass http://services; + } + if ($host = links.pena.digital) { + proxy_pass http://dwarfener; + } + if ($host = oauth.pena.digital) { + proxy_pass http://pena-social-auth-service:8000; } }