[GH-ISSUE #779] Header X-Forwarded-For not being shown on logs #356

Closed
opened 2026-02-26 10:32:04 +03:00 by kerem · 4 comments
Owner

Originally created by @tetebueno on GitHub (Nov 4, 2024).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/779

This issue is unique.

  • I have used the search tool and did not find an issue describing my bug.

Operating System of DocumentServer

Docker

Version information

8.1.1

Expected Behavior

When making a request to Document server, I intended to see client's IP address on logs.

Actual Behavior

I'm currently seeing Docker network gateway's IP as client IP.

Reproduction Steps

  1. Open any document from Nextcloud app.
  2. Copy the URL of the request sent to Document server (from Chrome's dev tools, an URL like https://document-server.url/8.1.1-26/web-apps/apps/spreadsheeteditor/main/index_loader.html?_dc=8.1.1-26&lang=en&customer=ONLYOFFICE&type=desktop&frameEditorId=iframeEditor&isForm=false&compact=true&parentOrigin=https://nextcloud-server.url&uitheme=theme-dark&fileType=xlsx&indexPostfix=_loader)
  3. Paste it on an browser without access to document server (a Chrome incognito window).
  4. Access is denied.
  5. Check logs, an entry can be seen with the gateway's IP address like this:
2024/11/04 22:27:31 [error] 9101#9101: *1736 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 172.18.0.1, server: , request: "GET /8.1.1-26/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "document-server.url"

Additional information

Nginx in front of Document server service is configured with X-Forwarded-For header just like recommended configuration states.

Originally created by @tetebueno on GitHub (Nov 4, 2024). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/779 ### This issue is unique. - [X] I have used the [search tool](https://github.com/ONLYOFFICE/DocumentServer/issues?q=) and did not find an issue describing my bug. ### Operating System of DocumentServer Docker ### Version information 8.1.1 ### Expected Behavior When making a request to Document server, I intended to see client's IP address on logs. ### Actual Behavior I'm currently seeing Docker network gateway's IP as client IP. ### Reproduction Steps 1. Open any document from Nextcloud app. 2. Copy the URL of the request sent to Document server (from Chrome's dev tools, an URL like https://document-server.url/8.1.1-26/web-apps/apps/spreadsheeteditor/main/index_loader.html?_dc=8.1.1-26&lang=en&customer=ONLYOFFICE&type=desktop&frameEditorId=iframeEditor&isForm=false&compact=true&parentOrigin=https://nextcloud-server.url&uitheme=theme-dark&fileType=xlsx&indexPostfix=_loader) 3. Paste it on an browser without access to document server (a Chrome incognito window). 4. Access is denied. 5. Check logs, an entry can be seen with the gateway's IP address like this: ``` 2024/11/04 22:27:31 [error] 9101#9101: *1736 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 172.18.0.1, server: , request: "GET /8.1.1-26/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "document-server.url" ``` ### Additional information Nginx in front of Document server service is configured with `X-Forwarded-For` header just like [recommended configuration](https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/proxy-https-to-http.conf#L33) states.
kerem 2026-02-26 10:32:04 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@igwyd commented on GitHub (Nov 7, 2024):

Hello @tetebueno, this error with socket.io.min.js.map occurs because you are open dev-tools, but not because you sent not authorizired reauest. We know about it and we have the ticket #61138
You can see more detail here https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/763#issuecomment-1471875705

<!-- gh-comment-id:2461405680 --> @igwyd commented on GitHub (Nov 7, 2024): Hello @tetebueno, this error with **socket.io.min.js.map** occurs because you are open dev-tools, but not because you sent not authorizired reauest. We know about it and we have the ticket #61138 You can see more detail here https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/763#issuecomment-1471875705
Author
Owner

@tetebueno commented on GitHub (Dec 2, 2024):

Hey there, the main goal behind the issue was not the reason behind the request being sent, but the IP shown on logs.

Expected Behavior
When making a request to Document server, I intended to see client's IP address on logs.

<!-- gh-comment-id:2511324894 --> @tetebueno commented on GitHub (Dec 2, 2024): Hey there, the main goal behind the issue was not the reason behind the request being sent, but the IP shown on logs. > Expected Behavior > When making a request to Document server, I intended to see client's IP address on logs.
Author
Owner

@tetebueno commented on GitHub (Dec 12, 2024):

Just realized this got closed. Any chance for last comment to be reviewed?

<!-- gh-comment-id:2537569522 --> @tetebueno commented on GitHub (Dec 12, 2024): Just realized this got closed. Any chance for last comment to be reviewed?
Author
Owner

@igwyd commented on GitHub (Dec 12, 2024):

I see real client ip on my stand, i guess this is because you using external proxy and the same header we usung in our standart nginx configuration inside container. We cannot provide for all possible configurations and networks from proxies, so there is a default proxy example. In your case you can specify that you need to take a real IP from X-Forwarded-For by adding real_ip_header X-Forwarded-For; to the http context in nginx inside docker container.

<!-- gh-comment-id:2537990925 --> @igwyd commented on GitHub (Dec 12, 2024): I see real client ip on my stand, i guess this is because you using external proxy and [the same header](https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/proxy-https-to-http.conf#L33C1-L33C61) we usung in our standart nginx configuration inside container. We cannot provide for all possible configurations and networks from proxies, so there is a default proxy example. In your case you can specify that you need to take a real IP from ```X-Forwarded-For``` by adding ```real_ip_header X-Forwarded-For;``` to the http context in nginx inside docker container.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#356
No description provided.