From c881641541388a6121eeeafa26de70c250b26043 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 26 Mar 2022 20:29:03 +0700 Subject: [PATCH] Should be working ! --- conf/.env | 1 - conf/nginx.conf | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/conf/.env b/conf/.env index 313b1a9..8ea98a5 100644 --- a/conf/.env +++ b/conf/.env @@ -1,5 +1,4 @@ MINIO_ROOT_USER=__APP__ MINIO_ROOT_PASSWORD=__MINIO_KEY__ MINIO_VOLUMES="__DATADIR__/" -MINIO_BROWSER_REDIRECT_URL=https://__DOMAIN__ MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__CONSOLE_PORT__" diff --git a/conf/nginx.conf b/conf/nginx.conf index 0e03b64..8cef6fb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,11 @@ -location ~ ^/server(/?)(.*) { +location ~ ^/(api|login|styles|static|(?!.+/).*) { - # Force usage of https +# Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1/$2:__PORT__/; + proxy_pass http://127.0.0.1:__CONSOLE_PORT__; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_cache_bypass $http_upgrade; @@ -18,16 +18,17 @@ location ~ ^/server(/?)(.*) { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + } -location / { - - # Force usage of https +location ~ / { + +# Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__CONSOLE_PORT__/; + proxy_pass http://127.0.0.1:__PORT__; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_cache_bypass $http_upgrade; @@ -40,4 +41,5 @@ location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; -} + +} \ No newline at end of file