diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 4d54de4ee4..b15f8ab0c2 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -90,29 +90,7 @@ server { proxy_set_header Connection $proxy_connection; proxy_set_header Proxy ""; - - location ~* ^/ds-vpath/ { - rewrite /ds-vpath/(.*) /$1 break; - - proxy_pass http://172.18.0.4:80; - proxy_redirect off; - - client_max_body_size 100m; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $proxy_connection; - - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host/ds-vpath; - proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; - - } - - location / { - set $csp ""; + set $csp ""; access_by_lua ' if ngx.req.get_method() == "GET" then local key = string.format("csp:%s",ngx.var.host) @@ -137,6 +115,28 @@ server { end end '; + + location ~* ^/ds-vpath/ { + rewrite /ds-vpath/(.*) /$1 break; + + proxy_pass http://172.18.0.4:80; + proxy_redirect off; + + client_max_body_size 100m; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $proxy_connection; + + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host/ds-vpath; + proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; + + } + + location / { proxy_pass http://127.0.0.1:5001; location ~* /(manifest.json|sw.js|appIcon(.)*\.png|icon.svg|bg-error.png|favicon.ico|debuginfo.md) { try_files /$basename /index.html =404;