avatar

十六小站

欢迎来到我的个人主页! 期待与您分享我的经验与故事,一起探索技术的无穷可能!

  • 首页
  • NAS专题
  • 关于
Home onlyoffice配置
文章

onlyoffice配置

Posted 2025-03-27 Updated 2025-03- 28
By 十六 已删除用户
5~7 min read
  1. onlyoffice层配置别名请求,解决多数场景下,系统只有一个请求入口的情况。

目前这里只附加nginx配置 ,后续补充部署配置:别名统一为:my_office

这里主要需要代理的有api.js的入口路径和cache的文件库路径。

cache路径需要修配office的default.json配置,修改如下:

storage:{
  "bucketName":"my_office/cache"
}

nginx配置如下:

        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 $http_upgrade $proxy_connection {
          default upgrade;
          "" close;
        }
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        proxy_set_header X-Forwarded-Host $the_host;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        server {
          listen 0.0.0.0:8093;
          listen [::]:8093 default_server;
          server_tokens off;
          rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
          location /sino_office/ {
                proxy_pass http://localhost:8000/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 3600s;  # 设置较长的超时时间 
          }

          location /sino_office/cache/ {
                proxy_pass http://localhost:8000/sino_office/cache/;
                proxy_http_version 1.1;
          }

        }

外层代理配置,统一入口,后续可以在这里添加负载均衡:

server {
    listen 80;
    server_name _;
 
    location /sino_office {
        # 基本代理设置 
        proxy_pass http://192.168.1.135:8093/my_office/;
        
        # 请求头设置(包含端口信息)
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;
 
        # WebSocket 支持 
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 3600s;  # 设置较长的超时时间 
    }
}

后端
License:  CC BY 4.0
Share

Further Reading

Sep 30, 2025

微服务之Auth篇

auth服务重要是认证授权,签发jwt token使用。 生成密钥对 # 在项目 src/main/resources 下生成 jwt.jks(演示用,生产用更严格的密码/keystore) keytool -genkeypair \ -alias jwt \ -keyalg RSA \

Sep 6, 2025

SpringBoot3.X-2(缓存Redis/memory)

本文主要是实现缓存的集成,由于是单体项目 ,目前整合了内存缓存和Redis缓存两种,可以通过配置来切换。 引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-sta

Sep 5, 2025

SpringBoot3.X-1(MP+Druid)

本次基于springboot-3.5.5,先附上文档地址:https://docs.spring.io/spring-boot/reference/data/sql.html 初始化springboot项目 项目创建步骤不做记录 集成mybaits-plus</

OLDER

Jvm参数

NEWER

在WEB中子线程可以访问Request上下文

Recently Updated

  • KubeShpere部署(4.1.2)
  • 微服务之Auth篇
  • 记一次前端优化(vue2)
  • SpringBoot3.X-2(缓存Redis/memory)
  • SpringBoot3.X-1(MP+Druid)

Trending Tags

Java Docker 前端 中间件 数据库 群晖 unraid

Contents

©2025 十六小站. Some rights reserved.

Using the Halo theme Chirpy