3x-ui README

The project's README from github.com/x4gpanell/3x-ui. As one markdown file: README.md.

3x-ui روی Railway با یک پورت واحد (بدون TCP Proxy)

این ریپازیتوری، 3x-ui رو به همراه یک nginx reverse proxy اجرا می‌کند که هم پنل وب و هم اینباند VLESS/WebSocket شما را از طریق یک پورت واحد (همان پورتی که Railway اختصاص می‌دهد) در دسترس می‌گذارد — دقیقاً مثل معماری RVG.

چرا این کار لازم بود؟

به‌صورت پیش‌فرض، 3x-ui پنل وب را روی یک پورت و هر Inbound را روی پورت دیگری اجرا می‌کند. Railway Public Domain فقط به یک پورت داخلی وصل می‌شود، پس یا پنل در دسترس بود یا Inbound، نه هر دو. این نسخه با اضافه کردن nginx، هر دو را زیر یک پورت مدیریت می‌کند.

مراحل دیپلوی

۱. ریپازیتوری بسازید

یک ریپازیتوری جدید در گیت‌هاب بسازید (خصوصی یا عمومی، فرقی ندارد) و این سه فایل را در ریشه‌ی آن قرار دهید:

۲. در Railway

  1. New Project → Deploy from GitHub repo و همین ریپازیتوری را انتخاب کنید
  2. Railway به‌طور خودکار Dockerfile را تشخیص و بیلد می‌کند
  3. بعد از اتمام دیپلوی، به Settings → Networking بروید و Generate Domain بزنید (فقط همین یک دامنه لازم است، نیازی به Target Port خاص نیست چون nginx مستقیماً روی $PORT گوش می‌دهد)

۳. اولین ورود به پنل

آدرس پنل شما این خواهد بود:

https://دامنه‌شما.up.railway.app/managepanel/

یوزرنیم/پسورد پیش‌فرض 3x-ui را وارد کنید (admin/admin) و حتماً بلافاصله از بخش تنظیمات تغییرش دهید.

۴. ساخت Inbound

در پنل، یک Inbound جدید بسازید با این تنظیمات دقیق:

فیلد مقدار
Protocol VLESS
Listen Port 8080 (این عدد نباید تغییر کند، چون nginx دقیقاً به همین پورت وصل است)
Listen IP خالی یا 0.0.0.0
Network ws
Security none
Path هر مسیر دلخواه، مثلاً /cdn

⚠️ اگر بخواهید پورت Inbound را عددی غیر از 8080 بگذارید، باید داخل فایل nginx.conf.template هم مقدار 127.0.0.1:8080 را با همان عدد جدید هماهنگ کنید و دوباره Push/Deploy کنید.

۵. ساخت لینک کلاینت

vless://UUID@دامنه‌شما.up.railway.app:443?encryption=none&security=tls&sni=دامنه‌شما.up.railway.app&fp=chrome&type=ws&host=دامنه‌شما.up.railway.app&path=%2Fcdn#MyConfig

جای UUID و دامنه‌شما و path را با مقادیر واقعی خودتان جایگزین کنید.

تست سریع (قبل از تست با v2rayNG)

در مرورگر باز کنید:

https://دامنه‌شما.up.railway.app/cdn

باید پیام "Bad Request" ببینید (یعنی درخواست به Xray رسیده). اگر پنل هم به همین شکل جواب داد یعنی مسیر nginx سالم است:

https://دامنه‌شما.up.railway.app/managepanel/

نکات مهم

3x-ui (x4gpanell/3x-ui)

Searching Database…

400 ·GitHub
What is this?This is a Railway deployment setup for the 3x-ui panel that adds an nginx reverse proxy so both the web panel and a VLESS/WebSocket inbound are reachable through the single port Railway assigns to your deployment.
Is this 3x-ui itself or just a deployment wrapper around it?It is a wrapper around 3x-ui: the repo ships a Dockerfile, an nginx.conf.template, and a start.sh script that run 3x-ui alongside nginx, routing panel and inbound traffic to the same exposed port.
How do I deploy this on Railway?Push the Dockerfile, nginx.conf.template and start.sh to a new GitHub repo, then in Railway choose New Project then Deploy from GitHub repo and pick that repo; Railway auto-detects the Dockerfile and builds it, after which you generate a domain under Settings then Networking (no specific target port needed since nginx listens directly on $PORT).
What do I need before deploying this?You need a GitHub repository (private or public) containing the three provided files and a Railway project connected to that repo; no extra tools are required beyond that.
What should I watch out for after deploying?All inbounds must listen on the fixed internal port 8080 because nginx only proxies that one port, and panel data under /etc/x-ui lives on the container's temporary filesystem - it gets wiped on redeploy unless you attach a Railway Volume to that path.
What's the default panel login, and should I change it?The default 3x-ui credentials are admin/admin, and the README stresses that you should change them immediately from the settings section right after first login.
Why not just run 3x-ui directly on Railway without this nginx layer?3x-ui normally serves its panel and each inbound on separate ports, but Railway's Public Domain only forwards a single internal port - without this nginx wrapper you could only reach the panel or the proxy inbound, never both.
Can I create more than one VLESS inbound this way?Yes, as long as every inbound listens on the same internal port 8080; different inbounds can use different WebSocket paths since nginx only distinguishes them by path, not by TCP port.
Creator
x4gpanell
Size
<0.1 MB
Stars
400
Updated
CommitSep 27
Age
2mo
Commits · 90 Days