DocSpace-buildtools/config/nginx/onlyoffice.conf

146 lines
3.7 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;
}
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;
add_header Access-Control-Allow-Origin *;
large_client_header_buffers 4 16k;
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
2019-08-21 12:31:31 +00:00
gzip on;
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 "";
location / {
proxy_pass http://localhost:5001;
2019-12-11 12:18:55 +00:00
location ~* /(manifest.json|service-worker.js|appIcon.png|bg-error.png) {
2019-12-05 15:26:43 +00:00
root $public_root;
try_files /$basename /index.html =404;
}
}
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;
2019-12-05 15:26:43 +00:00
proxy_pass http://localhost: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";
}
location /api/2.0 {
proxy_pass http://localhost:5000;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-10 11:57:30 +00:00
2019-12-05 15:26:43 +00:00
location ~* /(people|group) {
proxy_pass http://localhost:5004;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-02-26 10:01:12 +00:00
}
2020-02-27 08:22:42 +00:00
location ~* /(files|encryption) {
2020-02-26 10:01:12 +00:00
proxy_pass http://localhost:5007;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-15 13:57:53 +00:00
}
2019-12-05 15:26:43 +00:00
}
2019-07-15 13:57:53 +00:00
2019-12-05 15:26:43 +00:00
location /storage {
proxy_pass http://localhost:5003;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /products {
2019-12-05 15:26:43 +00:00
location ~* /people {
#rewrite products/people/(.*) /$1 break;
proxy_pass http://localhost:5002;
2019-09-09 13:28:43 +00:00
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2020-02-26 07:02:37 +00:00
location ~* /(sockjs-node|locales) {
rewrite products/people(.*)/(sockjs-node|locales)/(.*) /$2/$3 break;
2019-12-05 15:26:43 +00:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
2019-12-05 15:26:43 +00:00
proxy_pass http://localhost:5002;
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";
}
2020-02-25 06:58:09 +00:00
location ~* /(manifest.json|service-worker.js|appIcon.png|bg-error.png) {
root $public_root;
try_files /$basename /index.html =404;
}
}
location ~* /files {
#rewrite products/files/(.*) /$1 break;
proxy_pass http://localhost:5008;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
location ~* /(sockjs-node|locales) {
rewrite products/files(.*)/(sockjs-node|locales)/(.*) /$2/$3 break;
2020-02-25 06:58:09 +00:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://localhost:5008;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
2019-12-11 12:18:55 +00:00
location ~* /(manifest.json|service-worker.js|appIcon.png|bg-error.png) {
2019-12-05 15:26:43 +00:00
root $public_root;
try_files /$basename /index.html =404;
2019-07-15 11:45:07 +00:00
}
}
2019-07-15 13:57:53 +00:00
}
2019-12-11 15:15:10 +00:00
}