[GH-ISSUE #2994] How to use cloudflare with? #1999

Closed
opened 2026-10-31 20:22:30 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @vadez4822 on GitHub (May 10, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/2994

Question

Hi everyone, I'm setting up a VPN and trying to proxy my domain (which is pointed to the IP of my X-UI server) through Cloudflare. As I understand it, specifying the IP in the inbound configuration bypasses this setup and Cloudflare is not involved, since the client connects directly to the IP.

Here are the details:

All X-UI settings are correctly configured, and internet access on the client is working. On ipinfo.io, the client shows the IP of my server (the one to which the domain is pointed).
Both the client and X-UI use VLESS with XHTTP transport.

In the client's outbound settings (from link or QR code), the address is set to the IP of the X-UI server.
However, under Transport and Security, the Host and SNI are set to ******.cloud, which is my domain.
With this setup, internet on the iPhone works. But ipinfo still shows the server IP, not a Cloudflare IP.

Cloudflare is set up correctly, and tests confirm that ******.cloud is being proxied.

The moment I replace the IP in the client's address field with the domain (******.cloud) and turn the client on — the internet stops working.

DNS routing rules are also created in X-UI.

Please help me, I haven't slept in two days already 🤣🤦‍♂️

Checklist

  • This question is written entirely in English.
Originally created by @vadez4822 on GitHub (May 10, 2025). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/2994 ### Question Hi everyone, I'm setting up a VPN and trying to proxy my domain (which is pointed to the IP of my X-UI server) through Cloudflare. As I understand it, specifying the IP in the inbound configuration bypasses this setup and Cloudflare is not involved, since the client connects directly to the IP. Here are the details: All X-UI settings are correctly configured, and internet access on the client is working. On ipinfo.io, the client shows the IP of my server (the one to which the domain is pointed). Both the client and X-UI use VLESS with XHTTP transport. In the client's outbound settings (from link or QR code), the address is set to the IP of the X-UI server. However, under Transport and Security, the Host and SNI are set to ******.cloud, which is my domain. With this setup, internet on the iPhone works. But ipinfo still shows the server IP, not a Cloudflare IP. Cloudflare is set up correctly, and tests confirm that ******.cloud is being proxied. The moment I replace the IP in the client's address field with the domain (******.cloud) and turn the client on — the internet stops working. DNS routing rules are also created in X-UI. Please help me, I haven't slept in two days already 🤣🤦‍♂️ ### Checklist - [x] This question is written entirely in English.
bsakaguchi 2026-10-31 20:22:30 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@chanhanzhan commented on GitHub (May 11, 2025):

You can try to configure warp to proxy traffic, which will be more convenient and fast.

<!-- gh-comment-id:2870059178 --> @chanhanzhan commented on GitHub (May 11, 2025): You can try to configure warp to proxy traffic, which will be more convenient and fast.
Author
Owner

@LeenHawk commented on GitHub (May 12, 2025):

I know it, please check the rebot protection in cloudflare

<!-- gh-comment-id:2871636468 --> @LeenHawk commented on GitHub (May 12, 2025): I know it, please check the rebot protection in cloudflare
Author
Owner

@glaicodes commented on GitHub (Jun 4, 2025):

I got a Linux server and a domain from spaceship. When I don't enter my domain for cloudflare SSL setting, I can access the panel and proxy works. Howe, when I enter my domain and get the SSL, I can't access the panel anymore. What can I do?

<!-- gh-comment-id:2940949678 --> @glaicodes commented on GitHub (Jun 4, 2025): I got a Linux server and a domain from spaceship. When I don't enter my domain for cloudflare SSL setting, I can access the panel and proxy works. Howe, when I enter my domain and get the SSL, I can't access the panel anymore. What can I do?
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#1999
No description provided.