442a6bb30a
# Conflicts: # config/nginx/onlyoffice.conf # web/ASC.Web.Api/Controllers/SettingsController.cs # web/ASC.Web.Studio/Startup.cs
286 lines
7.9 KiB
Plaintext
286 lines
7.9 KiB
Plaintext
map $http_host $this_host {
|
|
"" $host;
|
|
default $http_host;
|
|
}
|
|
|
|
map $http_x_forwarded_proto $the_scheme {
|
|
default $http_x_forwarded_proto;
|
|
"" $scheme;
|
|
}
|
|
|
|
map $http_x_forwarded_host $the_host {
|
|
default $http_x_forwarded_host;
|
|
"" $this_host;
|
|
}
|
|
|
|
map $uri $basename {
|
|
~/(?<captured_basename>[^/]*)$ $captured_basename;
|
|
}
|
|
|
|
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 {
|
|
default "no-cache, no-store, must-revalidate";
|
|
~*\/(api\/2\.0.*|storage|login\.ashx|products\/.+\/httphandlers\/filehandler\.ashx|ChunkedUploader.ashx|apisystem|sh|remoteEntry\.js|debuginfo\.md) "no-cache, no-store, must-revalidate";
|
|
~*\/(locales.*\.json) "public, no-transform";
|
|
~*\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|md|css|js)$ "public, no-transform";
|
|
}
|
|
|
|
include /etc/nginx/includes/onlyoffice-*.conf;
|
|
|
|
|
|
server {
|
|
listen 8092;
|
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header X-Frame-Options $header_x_frame_options;
|
|
add_header Cache-Control $cache_control;
|
|
root $public_root;
|
|
etag on;
|
|
|
|
large_client_header_buffers 4 16k;
|
|
client_max_body_size 4G;
|
|
set $X_REWRITER_URL $the_scheme://$the_host;
|
|
|
|
if ($http_x_rewriter_url != '') {
|
|
set $X_REWRITER_URL $http_x_rewriter_url ;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
|
|
|
|
fastcgi_read_timeout 600;
|
|
fastcgi_send_timeout 600;
|
|
fastcgi_keep_conn on;
|
|
fastcgi_intercept_errors on;
|
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param HTTP_X_REWRITER_URL $http_x_rewriter_url;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PATH_INFO "";
|
|
|
|
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 "upgrade";
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
location / {
|
|
|
|
proxy_pass http://localhost:5001;
|
|
location ~* /(manifest.json|sw.js|appIcon.png|bg-error.png|favicon.ico|debuginfo.md) {
|
|
try_files /$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /static/images/icons/(?<content>[^/]+) {
|
|
try_files /images/icons/$content/$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /static/images/ {
|
|
try_files /images/$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /static/fonts/ {
|
|
try_files /fonts/$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /static/offline/ {
|
|
try_files /offline/$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /thirdparty/ {
|
|
try_files /thirdparty/third-party.html /index.html =404;
|
|
}
|
|
|
|
location ~* /static/locales/(?<content>[^/]+) {
|
|
try_files /locales/$content/$basename /index.html =404;
|
|
}
|
|
|
|
location ~* /static/scripts/ {
|
|
try_files /scripts/$basename /index.html =404;
|
|
}
|
|
|
|
}
|
|
|
|
location /login {
|
|
#rewrite login/(.*) /$1 break;
|
|
proxy_pass http://localhost:5011;
|
|
}
|
|
|
|
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://localhost:5001;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
location /api/2.0 {
|
|
location ~* /(files|encryption|privacyroom) {
|
|
proxy_pass http://localhost:5007;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location ~* /(people|group) {
|
|
proxy_pass http://localhost:5004;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location ~* /(authentication|modules|portal|security|settings|smtpsettings|capabilities|thirdparty) {
|
|
proxy_pass http://localhost:5000;
|
|
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://localhost:5012;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location ~* authentication/register(.*) {
|
|
rewrite (.*)/authentication/register(.*) $1/people/register$2 break;
|
|
proxy_redirect off;
|
|
|
|
proxy_pass http://localhost:5004;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
}
|
|
|
|
location ~* /backup {
|
|
proxy_pass http://localhost:5012;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
}
|
|
|
|
location ~* /(ssologin.ashx|login.ashx|storage) {
|
|
proxy_pass http://localhost:5003;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location /socket.io/ {
|
|
proxy_pass http://localhost: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;
|
|
}
|
|
|
|
location /backupFileUpload.ashx {
|
|
proxy_pass http://localhost:5012;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location /products {
|
|
location ~* /people {
|
|
#rewrite products/people/(.*) /$1 break;
|
|
proxy_pass http://localhost:5002;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
|
|
location ~* /(sockjs-node) {
|
|
rewrite products/people(.*)/(sockjs-node)/(.*) /$2/$3 break;
|
|
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;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
|
|
location ~* /(manifest.json|service-worker.js|appIcon.png|bg-error.png) {
|
|
try_files /$basename /index.html =404;
|
|
}
|
|
}
|
|
|
|
location ~* /files/doceditor {
|
|
#rewrite products/files/doceditor/(.*) /$1 break;
|
|
proxy_pass http://localhost:5013;
|
|
proxy_redirect off;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
location ~* /files {
|
|
#rewrite products/files/(.*) /$1 break;
|
|
proxy_pass http://localhost:5008;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
|
|
location ~* /sockjs-node {
|
|
rewrite products/files(.*)/sockjs-node/(.*) /$2/$3 break;
|
|
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";
|
|
}
|
|
|
|
location ~* /(manifest.json|service-worker.js|appIcon.png|bg-error.png) {
|
|
try_files /$basename /index.html =404;
|
|
}
|
|
|
|
location ~* (/httphandlers/filehandler.ashx|ChunkedUploader.ashx) {
|
|
proxy_pass http://localhost:5007;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
}
|
|
}
|
|
|
|
location /apisystem {
|
|
rewrite apisystem/(.*) /$1 break;
|
|
proxy_pass http://localhost:5010;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
|
|
location /sh {
|
|
rewrite sh/(.*) /$1 break;
|
|
proxy_pass http://localhost:9999;
|
|
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
|
|
}
|
|
}
|