Domain Configuration
This guide explains how to expose txAdmin and FXServer securely using either Nginx Reverse Proxy or Cloudflare Tunnels.
Nginx Reverse Proxy
If you do not already have Nginx installed please follow these instructions first:
If you do not have experience with Nginx or this seems to hard for you we suggest you stick with Cloudflare Tunnels.
Verify Nginx Installation
If you alread have Nginx installed this command should say its Running and you can skip the three steps below.
sudo systemctl status nginxUpdate your package index:
sudo apt updateInstall Nginx
sudo apt install nginxStart and Enable Nginx
sudo systemctl start nginxsudo systemctl enable nginx Generate Cloudflare Certificates
- Log in to Cloudflare and select your domain.
- Go to SSL/TLS → Origin Server.
- Click Create Certificate.
- Ensure your subdomain (e.g.,
txadmin.example.com) and wildcard (*.example.com) are included.example
Install Cloudflare Certificates
Save the certificates to:
sudo nano /etc/ssl/certs/cloudflare_origin.pemsudo nano /etc/ssl/private/cloudflare_origin.keyConfiguring Nginx (txAdmin)
Create the following Nginx config file for txAdmin:
sudo nano /etc/nginx/sites-available/txadminserver {
listen 80;
server_name txadmin.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name txadmin.example.com;
ssl_certificate /etc/ssl/certs/cloudflare_origin.pem;
ssl_certificate_key /etc/ssl/private/cloudflare_origin.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:40120;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100M;
}
}Configuring Nginx (FXServer)
Create the following Nginx config file for FXServer:
sudo nano /etc/nginx/sites-available/fxserverserver {
listen 80;
server_name connect.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name connect.example.com;
ssl_certificate /etc/ssl/certs/cloudflare_origin.pem;
ssl_certificate_key /etc/ssl/private/cloudflare_origin.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:30120;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100M;
}
}Enable and Restart Nginx
sudo ln -s /etc/nginx/sites-available/txadmin /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/fxserver /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx6. Configuring DNS Records
- Back in Cloudflare navigate to DNS → Records
- Create a new
Arecord for your txAdmin domain (eg.txadmin.example.com) - Create another
Arecord for your FXServer domain (eg.connect.example.com) - For the IPv4 address enter your server IP Address
- Ensure the connection is proxied
example
7. Configuring SSL Mode(s)
- Navigate to SSL/TLS → Overview
- Under SSL/TLS encryption click the configure button
- Ensure your SSL is set to
FullorFull (Strict)example
Cloudflare Tunnels (Recommended)
Cloudflare Tunnels is the recommended way to expose txAdmin and FXServer to the internet. It does not require you to open any ports, comes with HTTPS/SSL and DDoS protection out of the box, and you can enable Rate Limiting in Cloudflare's WAF Rules.
For more information check out the official Cloudflare Tunnel docs (opens in a new tab).
Install cloudflared
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared.debAuthenticate with Cloudflare
This will open a browser window where you select the domain you want to use.
cloudflared tunnel loginCreate a Tunnel
Replace my-tunnel with whatever you want to name it.
cloudflared tunnel create my-tunnelTake note of the Tunnel ID it gives you, you will need it later.
Configure the Tunnel
Create the config file:
sudo nano ~/.cloudflared/config.ymlPaste the following and replace the values with your own:
tunnel: <your-tunnel-id>
credentials-file: /root/.cloudflared/<your-tunnel-id>.json
ingress:
- hostname: txadmin.example.com
service: http://localhost:40120
- hostname: connect.example.com
service: http://localhost:30120
- service: http_status:404Route DNS
This creates the DNS records in Cloudflare for you automatically.
cloudflared tunnel route dns my-tunnel txadmin.example.com
cloudflared tunnel route dns my-tunnel connect.example.comStart the Tunnel
cloudflared tunnel run my-tunnelInstall as a Service
So the tunnel starts automatically on boot:
sudo cloudflared service install
sudo systemctl enable cloudflared
sudo systemctl start cloudflared