Skip to content

Incorrect value of SignerIP when using reverse proxy #7697

@qix67

Description

@qix67

Describe the bug

When libresign runs on a server staying behind a reverse proxy, SignerIP value is set to IP of reverse proxy instead of IP set inside X-Forw ded-for.When libresign runs on a server staying behind a reverse proxy, SignerIP value is set to IP of reverse proxy instead of IP set inside X-Forwarded-for.

To reproduce

  1. install a reverse proxy. In my case, I have an opnsense doing ssl termination with haproxy
  2. use a libresign installed on a server staying behind reverse proxy. I have a nginx+php-fpm with nextcloud+libresign running on a different computer. nginx logs contain correct client IP extracted from X-Forwarded-for
  3. try to sign any document

Expected behavior

SignerIP should be set to client IP and not reverse proxy IP

Screenshots

No response

Operational System

Reverse proxy runs on opnsense 26.1 with haproxy 3.2.14. Nextcloud runs on up to date gentoo with nginx 1.28.5, php-fpm 8.3.29, nextcloud 32.0.5, libresign 12.4.4

Browser Type and Version

No response

Libresign Version

12.4.4

Nextcloud Server Version

32.0.5

Logs from Nextcloud Server

fd51:XXXXXX::f4 - - [24/May/2026:05:47:35 +0200] "GET /cloud/apps/libresign/js/signingDocumentAdapter-CjaBR9eP.chunk.mjs HTTP/1.1" 200 1498 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36" "text/javascript" "2a01:XXXXXX:40" 0.000

First IP is the one used by libresign. Second IP is the real client IP

Logs from Developers tools

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    Status
    0. Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions