Reverse proxy in a subdir

Do you want to: Suggest a feature / Report a bug / Ask a how-to question
Document Server version: 7.5.1
Type of installation of the Document Server (docker, deb/rpm, exe)

Is it possible to make DocServer work in a subdirectory? My application is running on example(.)com, and I need OnlyOffice to function in a subdirectory, specifically example(.)com/docserver, for API/WOPI. When I attempted to proxy /docserver/ to OnlyOffice via Nginx, I encountered an issue: When the iframe with OnlyOffice tries to fetch its resources, it fetches them from example(.)com/[version]~oou/… instead of example(.)com/docserver/[version]~oou/. I even attempted to proxy /[version]~oou/, oo loaded but it led to a new set of problems, such as: “The file content corresponds to one of the following formats: pdf/djvu/xps/oxps, but the file has an inconsistent extension: docx.” This issue arises when I try to edit a docx file via the API.

Upd: Logs are empty btw, just monitoring stuff

Hi @Metavice,
Please try this example:

1 Like

Thank you! I’ll try tomorrow and write back


It still removes virtual path part with the new nginx conf

Please provide your nginx config.

Bump, pls. Still actual problem

@Metavice Hi, sorry for the late reply. Why do you set proxy_set_header Host $host;inside the /docserver location? Here Current nginx conf for ws · GitHub

I have tested a config without this header in this location and it worked correctly.

Apologies for the delayed response; I was unwell.

For some reason, it doesn’t work without this option. It just redirects me to a docservice without proxying.

Ohhh, seems like I’ve got it. It should be a scheme mismatch. My OO is up with Let’s Encrypt.