mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4719] [Bug]: panel wont open with SSL certificate #3263
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mat48 on GitHub (May 31, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4719
Describe the bug
I'm having the same issue as this one: #3920
If I want to get access to the panel after installation when the installer asks me if I want a certificate for the panel too
Would you like to set this certificate for the panel? (y/n):I have to choosenoand then use http instead of https to access the panel, otherwise the panel url won't work.I tried choosing no and then setting the ssl certificate manually in
x-ui > SSL Certificate Managementand I made sure they both are set toI also tried setting them via the panel setting but that didn't work either.
Am I doing something wrong or is it a bug?
How to reproduce the problem
3x-ui version
3.2.0
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@cryptonoise commented on GitHub (May 31, 2026):
I have exactly the same issue on Ubuntu 24.04 with 3x-ui installed via install.sh.
The panel is already working on my own domain, and SSL is handled through an Nginx reverse proxy using a valid certificate issued for that domain. In the 3x-ui panel SSL certificate fields I currently leave everything empty.
However, if I manually set the certificate paths in the panel to the same valid Let’s Encrypt files that are already used by Nginx, the panel becomes inaccessible (I don’t remember the exact error anymore).
@LORD07Sson commented on GitHub (May 31, 2026):
You should be given after the IP of the page, I did not understand your problem
@MHSanaei commented on GitHub (May 31, 2026):
@claude
@github-actions[bot] commented on GitHub (May 31, 2026):
Claude finished @MHSanaei's task in 2m 1s —— View job
SSL Certificate Configuration — Explanation & Likely Causes
There are two distinct scenarios described here, and both have clear explanations based on how the code works.
Scenario 1: Direct SSL (no reverse proxy) — mat48's case
When you configure the panel with SSL certificates, it binds TLS on the same non-standard port (the random port chosen during installation, e.g.
2053or whatever was generated). The panel does not move to port 443.The install script always shows the correct access URL at the end:
Most likely cause: You are accessing
https://your-domain.com(port 443) instead ofhttps://your-domain.com:PORT. The panel is listening on the configured port, not 443.Also worth checking: If cert file loading fails (wrong path or a permissions error), the server silently falls back to HTTP — see
web/web.go:411-423:In that case the panel is running HTTP even though you expect HTTPS. Check the x-ui service logs (
journalctl -u x-uiorx-ui log) for"Error loading certificates".Resolution steps:
x-ui setting -show trueto confirm the configured port.https://your-domain.com:PORT/basepath(include the port).privkey.pemshould be readable by the x-ui process.Scenario 2: Behind Nginx reverse proxy — cryptonoise's case
When Nginx terminates TLS and proxies plain HTTP to 3x-ui, the panel cert paths must be left empty. If you set cert paths in the panel, it switches to serving TLS itself. Nginx then sends plain HTTP to a TLS-expecting listener, causing the connection to fail.
Resolution: Clear the cert paths in the panel (Panel Settings → SSL Certificate → leave both fields blank) and restart the panel. Nginx handles all TLS; the panel only needs to speak plain HTTP to Nginx.
Summary
https://domain:PORT/basepathhttps://domain/...→ HTTP to panelIf you're still stuck after following the above, sharing the output of
journalctl -u x-ui --no-pager -n 50would help identify the exact error.@mat48 commented on GitHub (Jun 1, 2026):
Thank you
I used port 443 to install the panel and it fixed the problem. now the panel works perfectly.
I checked again and If I choose random ports other than 443 on installation phase, the panel wont open.
@mat48 commented on GitHub (Jun 1, 2026):
I used panel's setting to change the port and it caused the same problem as before. is there a manual workaround to safely change the port from 443 to something else?
or is it okay to revert back to an older version of the panel?