[GH-ISSUE #3891] [Bug report]: Invalid subscription. Client ip used as Inbound when reverse-proxy used. #2629

Closed
opened 2026-10-31 20:26:50 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @MKC-MKC on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3891

Describe the bug

When 3x-ui is deployed behind a reverse proxy (like: Nginx Proxy Manager), subscription links are generated with the wrong host:

Instead of using subscription settings (Sub Domain / Subscribe URI / server host), 3x-ui may use client-related request data (IP) and produce incorrect addresses in subscription output (including what clients like v2rayTun receive and others).

As a result, generated subscription endpoints can point to an invalid host for real client use.


Means,
Subscription links should always use configured subscription host/base URI (or proxy host), never client IP.

If an incoming request clearly indicates the need for listening, this also must be taken into account when creating a subscription also in JSON format.

How to repeat the problem?

  1. Install 3x-ui using reverse proxy like Nginx Proxy Manager.
  2. In 3x-ui, create an outbound/inbound with explicit listen values (example: IP YOUR_STATIC_IP, port YOUR)_LISTEN_PORT).
  3. Open Settings -> Subscription.
  4. Enable subscription`, ... JSON subscription also.
  5. Fill subscription fields (listen IP/domain/port/path/reverse proxy URI), save settings.
  6. Open a client subscription from generated link, and you can see client ip address instead of inbound (server) ip address.
  7. Import configuration to xray client , like v2RayTun. You will see the same problem here.

Expected action

No response

Received action

No response

3x-ui Version

any

Xray-core Version

No response

Checklist

  • This bug report is written entirely in English.
  • This bug report is new and no one has reported it before me.
Originally created by @MKC-MKC on GitHub (Mar 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3891 ### Describe the bug When 3x-ui is deployed behind a reverse proxy (like: Nginx Proxy Manager), subscription links are generated with the wrong host: Instead of using subscription settings (Sub Domain / Subscribe URI / server host), 3x-ui may use client-related request data (IP) and produce incorrect addresses in subscription output (including what clients like v2rayTun receive and others). As a result, generated subscription endpoints can point to an invalid host for real client use. --- Means, Subscription links should always use configured subscription host/base URI (or proxy host), never client IP. If an incoming request clearly indicates the need for listening, this also must be taken into account when creating a subscription also in JSON format. ### How to repeat the problem? 1. Install 3x-ui using reverse proxy like Nginx Proxy Manager. 2. In 3x-ui, create an outbound/inbound with explicit listen values (example: IP YOUR_STATIC_IP, port YOUR)_LISTEN_PORT). 3. Open `Settings` -> `Subscription`. 4. Enable subscription`, ... JSON subscription also. 5. Fill subscription fields (listen IP/domain/port/path/reverse proxy URI), save settings. 6. Open a client subscription from generated link, and you can see `client ip address` instead of `inbound (server) ip address`. 7. Import configuration to xray client , like v2RayTun. You will see the same problem here. ### Expected action _No response_ ### Received action _No response_ ### 3x-ui Version any ### Xray-core Version _No response_ ### Checklist - [x] This bug report is written entirely in English. - [x] This bug report is new and no one has reported it before me.
bsakaguchi 2026-10-31 20:26:50 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@MKC-MKC commented on GitHub (Mar 6, 2026):

and now, you can use ur pub ip and port as proxy.
and subscription now returns valid address inside subscription.

Image
<!-- gh-comment-id:4010570145 --> @MKC-MKC commented on GitHub (Mar 6, 2026): and now, you can use ur pub ip and port as proxy. and subscription now returns valid address inside subscription. <img width="1275" height="257" alt="Image" src="https://github.com/user-attachments/assets/1c7c9db2-af5b-45d5-8c6d-75767f52e8cc" />
Author
Owner

@MKC-MKC commented on GitHub (Mar 6, 2026):

Hmm. maybe I made a mistake in logic. I'll go for a review.

<!-- gh-comment-id:4010598020 --> @MKC-MKC commented on GitHub (Mar 6, 2026): Hmm. maybe I made a mistake in logic. I'll go for a review.
Author
Owner

@pavel-trubitsyn commented on GitHub (Apr 9, 2026):

and now, you can use ur pub ip and port as proxy. and subscription now returns valid address inside subscription.
Image

Is it actual? Where is the setting? I cannot find it in web ui.

UPD: For those who is seeking for this setting - it is located inside each Inbound connection.

<!-- gh-comment-id:4213986060 --> @pavel-trubitsyn commented on GitHub (Apr 9, 2026): > and now, you can use ur pub ip and port as proxy. and subscription now returns valid address inside subscription. > <img alt="Image" width="1275" height="257" src="https://private-user-images.githubusercontent.com/59623220/559204276-1c7c9db2-af5b-45d5-8c6d-75767f52e8cc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU3MzU3MzEsIm5iZiI6MTc3NTczNTQzMSwicGF0aCI6Ii81OTYyMzIyMC81NTkyMDQyNzYtMWM3YzlkYjItYWY1Yi00NWQ1LThjNmQtNzU3NjdmNTJlOGNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA5VDExNTAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU2YWY1Y2Q5MTQyOTEwNDRjOTkwMzNiN2ZmY2E3Njg0YjY0OWFkZTlmYTU4ZTU3YzIxZDdjMzU0YWVlMDU1NGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.75WBcYpLWJINFKkanEeCS4qnpqZul5VM8ZcwAxQsQQI"> Is it actual? Where is the setting? I cannot find it in web ui. UPD: For those who is seeking for this setting - it is located inside each **Inbound** connection.
Author
Owner

@MKC-MKC commented on GitHub (Apr 9, 2026):

Click Add Inbound, then, u cn fnd External Proxy near Security in yr VLESS config.

No changes needed...

Image
<!-- gh-comment-id:4214118313 --> @MKC-MKC commented on GitHub (Apr 9, 2026): Click `Add Inbound`, then, u cn fnd `External Proxy` near `Security` in yr `VLESS` config. No changes needed... <img width="815" height="770" alt="Image" src="https://github.com/user-attachments/assets/f3871183-008f-464d-8b45-d6bb970a497f" />
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
MHSanaei/3x-ui#2629
No description provided.