DocSpace-client/config/nginx/onlyoffice.conf

103 lines
2.6 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-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-08-06 13:18:07 +00:00
location ~* /sockjs-node {
2019-07-15 13:57:53 +00:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
2019-07-15 13:57:53 +00:00
proxy_pass http://localhost:5001;
2019-07-15 13:57:53 +00:00
proxy_redirect off;
2019-07-15 13:57:53 +00:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
2019-08-06 13:18:07 +00:00
location ~* /api/2.0 {
2019-07-15 13:57:53 +00:00
proxy_pass http://localhost:5000;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-10 11:57:30 +00:00
2019-08-06 13:18:07 +00:00
location ~* /(people|group) {
2019-07-15 13:57:53 +00:00
proxy_pass http://localhost:5004;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-07-15 11:45:07 +00:00
}
2019-07-15 13:57:53 +00:00
}
2019-09-09 13:28:43 +00:00
location ~* /storage {
proxy_pass http://localhost:5003;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
2019-07-15 13:57:53 +00:00
location /products {
2019-08-06 13:18:07 +00:00
location ~* /people {
2019-07-15 13:57:53 +00:00
#rewrite products/people/(.*) /$1 break;
proxy_pass http://localhost:5002;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
2019-08-21 08:00:22 +00:00
location ~* /(sockjs-node|images|locales|manifest.json) {
2019-08-14 13:55:56 +00:00
rewrite products/people(.*)/(sockjs-node|images|locales)/(.*) /$2/$3 break;
2019-08-21 08:00:22 +00:00
rewrite products/people/manifest.json /manifest.json break;
2019-08-13 14:48:04 +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:5002;
proxy_redirect off;
2019-07-15 13:57:53 +00:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2019-07-15 11:45:07 +00:00
}
}
}
2019-07-15 13:57:53 +00:00
}
}
2019-07-10 11:57:30 +00:00
include /etc/nginx/includes/onlyoffice-*.conf;