onlyOffice通过nginx自定义前缀代理

背景

很多时候对外端口只开放了一个,但是又需要使用onlyoffice进行文档预览

当前实践版本

onlyoffice8.3.0 docker-compose部署onlyoffice8.3.0并支持ssl,且支持通过nginx代理,关闭JWT配置

配置说明

配置如下

bash 复制代码
    location /onlyOffice/ {
    	# 这是onlyoffice的地址
        proxy_pass https://localhost:64431/;
        # 前缀配置,必须配置,可以看onlyoffice内部nginx中的重定向配置
        set  $the_prefix "/onlyOffice";
        # 这里必须配置为$http_host,让ip+端口都能传递到onlyoffice,否则重定向时会出问题
        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-Proto $scheme;
        # 由于onlyoffice中有websocket调用,下面的配置需要加上
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

onlyoffice内部nginx的前缀标识

相关推荐
闲云一鹤1 天前
nginx 快速入门教程 - 写给前端的你
前端·nginx·前端工程化
碳基沙盒1 天前
OpenClaw 多 Agent 配置实战指南
运维
蝎子莱莱爱打怪4 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
何中应4 天前
Nginx转发请求错误
前端·后端·nginx
DianSan_ERP5 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅5 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒5 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
芝士雪豹只抽瑞克五5 天前
Nginx 高性能Web服务器笔记
服务器·nginx
zhangfeng11335 天前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh