From 6f069fe4d1b7389e6285ac95d01b948c06e084d6 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Tue, 16 Jul 2024 16:39:05 +0400 Subject: [PATCH] Nginx: remove redirect to /login if cookie is not exists (too many links to skip) --- config/nginx/onlyoffice.conf | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 0e3254570b..3c94028b2a 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -104,16 +104,6 @@ server { local accept_header = ngx.req.get_headers()["Accept"] if ngx.req.get_method() == "GET" and accept_header ~= nil and string.find(accept_header, "html") and not ngx.re.match(ngx.var.request_uri, "ds-vpath|/api/") then - if not ngx.re.match(ngx.var.request_uri, "login|sdk|filehandler|thirdparty|confirm|error|wizard|preparation-portal|unavailable|notifications|payments|share=.|rooms/share(.*)key=.|/s/*|token=.|complete=.") then - if ngx.var.http_cookie == nil or not string.find(ngx.var.http_cookie, "asc_auth_key") then - if ngx.var.request_uri == "/" then - return ngx.redirect("/login") - else - return ngx.redirect("/login?referenceUrl=" .. ngx.var.request_uri) - end - end - end - local key = string.format("csp:%s",ngx.var.host) local redis = require "resty.redis" local red = redis:new()