Skip to content

Commit

Permalink
Nginx: remove redirect to /login if cookie is not exists (too many li…
Browse files Browse the repository at this point in the history
…nks to skip)
  • Loading branch information
AlexeySafronov committed Jul 16, 2024
1 parent c2a3b46 commit 6f069fe
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions config/nginx/onlyoffice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6f069fe

Please sign in to comment.