DocSpace-buildtools/config/nginx/onlyoffice.conf

269 lines
7.3 KiB
Plaintext
Raw Normal View History

2019-07-15 13:57:53 +00:00
map $http_host $this_host {
"" $host;
default $http_host;
}
2019-07-15 13:57:53 +00:00
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
2019-07-15 13:57:53 +00:00
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
2019-12-05 15:26:43 +00:00
map $uri $basename {
~/(?<captured_basename>[^/]*)$ $captured_basename;
}
2020-09-29 07:31:27 +00:00
map $request_uri $header_x_frame_options {
~*^/(favicon\.ico|products\/files\/share|products\/files\/saveas|products\/files\/filechoice|products\/files\/doceditor|thirdparty\/plugin) "";
default "SAMEORIGIN";
}
map $request_uri $cache_control {
2021-10-14 08:26:32 +00:00
default "no-cache, no-store, must-revalidate";
2023-01-31 11:40:06 +00:00
~*\/(api\/2\.0.*|storage|login\.ashx|products\/.+\/httphandlers\/filehandler\.ashx|ChunkedUploader.ashx|ThirdPartyAppHandler|apisystem|sh|remoteEntry\.js|debuginfo\.md|static\/scripts.*) "no-cache, no-store, must-revalidate";
~*\/(locales.*\.json) "must-revalidate, no-transform, max-age=900";
2023-01-31 18:37:21 +00:00
~*\/(images|favicon.ico.*)|\.(js|woff|woff2|css)|\/(storage\/room_logos\/root\/|storage\/userPhotos\/root\/) "public, max-age=31536000, immutable";
}
2019-12-11 15:15:10 +00:00
include /etc/nginx/includes/onlyoffice-*.conf;
2019-07-15 13:57:53 +00:00
server {
listen 8092;
2020-09-29 07:31:27 +00:00
add_header X-Frame-Options $header_x_frame_options;
add_header Cache-Control $cache_control;
root $public_root;
etag on;
2019-07-15 13:57:53 +00:00
large_client_header_buffers 4 16k;
2021-08-31 15:38:59 +00:00
client_max_body_size 4G;
2019-07-15 13:57:53 +00:00
set $X_REWRITER_URL $the_scheme://$the_host;
2019-07-15 13:57:53 +00:00
if ($http_x_rewriter_url != '') {
set $X_REWRITER_URL $http_x_rewriter_url ;
}
2019-07-15 13:57:53 +00:00
2022-12-26 17:29:09 +00:00
gzip on;
2019-08-21 12:31:31 +00:00
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
2019-07-15 13:57:53 +00:00
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_keep_conn on;
fastcgi_intercept_errors on;
2019-07-15 13:57:53 +00:00
include fastcgi_params;
2019-07-15 13:57:53 +00:00
fastcgi_param HTTP_X_REWRITER_URL $http_x_rewriter_url;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO "";
2020-10-09 19:40:06 +00:00
location ~* ^/ds-vpath/ {
2022-02-22 15:24:54 +00:00
rewrite /ds-vpath/(.*) /$1 break;
2020-10-09 19:40:06 +00:00
2022-02-22 15:24:54 +00:00
proxy_pass http://172.18.0.4:80;
proxy_redirect off;
2020-10-09 19:40:06 +00:00
2022-02-22 15:24:54 +00:00
client_max_body_size 100m;
2020-10-09 19:40:06 +00:00
2022-02-22 15:24:54 +00:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2020-10-09 19:40:06 +00:00
2022-02-22 15:24:54 +00:00
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 $the_host/ds-vpath;
proxy_set_header X-Forwarded-Proto $the_scheme;
2020-10-09 19:40:06 +00:00
}
2019-07-15 13:57:53 +00:00
location / {
2022-02-22 15:24:54 +00:00
proxy_pass http://127.0.0.1:5001;
2022-05-27 11:57:19 +00:00
location ~* /(manifest.json|sw.js|appIcon(.)*\.png|icon.svg|bg-error.png|favicon.ico|debuginfo.md) {
2019-12-05 15:26:43 +00:00
try_files /$basename /index.html =404;
}
2022-02-22 15:24:54 +00:00
2021-07-21 15:28:56 +00:00
location ~* /static/fonts/ {
try_files /fonts/$basename /index.html =404;
}
2022-02-22 15:24:54 +00:00
location ~* /static/offline/ {
try_files /offline/$basename /index.html =404;
}
2022-02-22 15:24:54 +00:00
location ~* /thirdparty/ {
try_files /thirdparty/third-party.html /index.html =404;
}
2022-02-22 15:24:54 +00:00
location ~* /static/locales/(?<content>[^/]+) {
try_files /locales/$content/$basename /index.html =404;
}
2021-08-19 10:32:31 +00:00
location ~* /static/scripts/ {
try_files /scripts/$basename /index.html =404;
}
location ~* /static/plugins/ {
try_files /plugins/$basename /index.html =404;
}
2019-12-05 15:26:43 +00:00
}
location /doceditor {
proxy_pass http://127.0.0.1:5013;
proxy_redirect off;
proxy_set_header Host $this_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
2022-02-22 15:24:54 +00:00
location /login {
2022-09-02 08:31:35 +00:00
proxy_pass http://127.0.0.1:5011;
2022-09-02 08:31:35 +00:00
proxy_redirect off;
2022-07-22 09:03:16 +00:00
proxy_set_header Host $this_host;
2022-09-02 08:31:35 +00:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
2022-07-22 09:03:16 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2022-09-02 08:31:35 +00:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2021-02-25 08:44:46 +00:00
}
2019-12-05 15:26:43 +00:00
location /sockjs-node {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:5001;
2019-12-05 15:26:43 +00:00
proxy_redirect off;
2019-12-05 15:26:43 +00:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
2019-12-05 15:26:43 +00:00
location /api/2.0 {
2022-10-19 10:12:33 +00:00
location ~* /(files|privacyroom) {
proxy_pass http://127.0.0.1:5007;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2019-12-05 15:26:43 +00:00
location ~* /(people|group) {
proxy_pass http://127.0.0.1:5004;
2021-02-17 13:41:29 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-02-26 10:01:12 +00:00
}
2022-02-22 15:24:54 +00:00
2022-10-19 10:12:33 +00:00
location ~* /(authentication|modules|portal|security|settings|smtpsettings|capabilities|thirdparty|encryption|feed) {
proxy_pass http://127.0.0.1:5000;
2020-10-30 10:04:29 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
location ~* portal/(.*)(backup|restore)(.*) {
rewrite (.*)/portal/(.*) $1/backup/$2 break;
proxy_redirect off;
proxy_pass http://127.0.0.1:5012;
2020-10-30 10:04:29 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-10-26 13:14:45 +00:00
}
2019-07-10 11:57:30 +00:00
2022-01-14 13:56:23 +00:00
location ~* authentication/register(.*) {
rewrite (.*)/authentication/register(.*) $1/people/register$2 break;
proxy_redirect off;
proxy_pass http://127.0.0.1:5004;
2022-01-14 13:56:23 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2020-10-30 10:04:29 +00:00
}
2022-02-22 15:24:54 +00:00
location ~* /backup {
proxy_pass http://127.0.0.1:5012;
2020-10-30 10:04:29 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-02-26 10:01:12 +00:00
}
location ~* /plugins {
proxy_pass http://127.0.0.1:5014;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2022-06-05 15:44:37 +00:00
location ~* /migration {
proxy_pass http://127.0.0.1:5034;
2022-06-05 15:44:37 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-02-26 10:01:12 +00:00
}
2020-10-30 10:04:29 +00:00
}
2019-07-15 13:57:53 +00:00
2022-06-24 07:32:04 +00:00
location /sso {
rewrite sso/(.*) /$1 break;
proxy_pass http://127.0.0.1:9834;
2022-06-24 07:32:04 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2022-04-25 18:41:26 +00:00
location ~* /(ssologin.ashx|login.ashx|storage) {
proxy_pass http://127.0.0.1:5003;
2019-12-05 15:26:43 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2022-02-22 15:24:54 +00:00
location /socket.io/ {
proxy_pass http://127.0.0.1:9899;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
2021-12-09 12:50:50 +00:00
}
2022-02-22 15:24:54 +00:00
2021-11-19 10:09:09 +00:00
location /backupFileUpload.ashx {
proxy_pass http://127.0.0.1:5012;
2021-11-19 10:09:09 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2022-05-05 14:07:24 +00:00
}
2022-11-15 11:11:44 +00:00
location /logoUploader.ashx {
proxy_pass http://127.0.0.1:5000;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2022-05-05 14:07:24 +00:00
location /ThirdPartyApp {
proxy_pass http://127.0.0.1:5007;
2022-05-05 14:07:24 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2021-11-19 10:09:09 +00:00
}
location /filehandler.ashx {
proxy_pass http://127.0.0.1:5007;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-15 13:57:53 +00:00
}
location /ChunkedUploader.ashx {
proxy_pass http://127.0.0.1:5007;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2020-05-19 17:41:37 +00:00
location /apisystem {
rewrite apisystem/(.*) /$1 break;
proxy_pass http://127.0.0.1:5010;
2020-05-19 17:41:37 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2020-05-22 09:41:14 +00:00
location /sh {
rewrite sh/(.*) /$1 break;
proxy_pass http://127.0.0.1:9999;
2020-05-22 09:41:14 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-15 13:57:53 +00:00
}
}