Back to blog

VPN and Website on One VPS: Fixing the Port 443 Conflict

November 8, 2026 3 min read

VLESS with Reality listens on TCP port 443 because that's where HTTPS traffic lives, which is exactly why it blends in. If the same server already hosts a website, nginx, Apache or Caddy has that port, and the VPN won't start:

listen tcp 0.0.0.0:443: bind: address already in use

Only one program can own a port. You have three ways out, from simplest to most flexible.

Option 1: Put the VPN on another port

Reality works on any TCP port. Move it to 8443 or similar, open the port in your firewall, and give your clients the new port.

sudo ufw allow 8443/tcp

The downside: some networks only allow outgoing traffic to 443, and a VPN on 8443 stands out a little more. For most home use it's fine. Nullsify lets you choose the port in its advanced VLESS settings.

Option 2: Use a second server

A VPS costs a few euros a month. Running your VPN on its own small server keeps it away from website downtime, certificate renewals and nginx upgrades, and the VPN gets port 443 to itself. If the website is important, this is the cleanest answer. You also avoid tying the VPN's IP address to your site's reputation, which matters if you're avoiding blocks.

Option 3: Let nginx share port 443 by hostname

nginx can read the hostname a client asks for before decrypting anything, and send the connection to the website or to Xray accordingly. The feature is called ssl_preread, and it lives in nginx's stream module, separate from the normal web server:

stream {
    map $ssl_preread_server_name $backend {
        www.yoursite.com  web;
        default           xray;
    }
    upstream web  { server 127.0.0.1:8443; }
    upstream xray { server 127.0.0.1:9443; }

    server {
        listen 443;
        ssl_preread on;
        proxy_pass $backend;
    }
}

Then:

  • change your website's nginx server block to listen on 127.0.0.1:8443 ssl instead of 443,
  • run Xray on 9443,
  • keep your clients pointed at port 443.

A Reality client asks for the cover site you chose (the serverNames value), not your website's name, so it falls to default and reaches Xray. Visitors asking for www.yoursite.com reach the website.

Check that your nginx has what it needs:

nginx -V 2>&1 | grep -o with-stream_ssl_preread_module

If that prints nothing, install the stream module (on Debian and Ubuntu: sudo apt install libnginx-mod-stream).

Caveats

  • It's more moving parts. If nginx fails, the VPN fails with it.
  • Xray sees nginx's address as the client, so per-client IP logs aren't useful.
  • Nullsify generates client links for the port it configured. With this layout you'd set the port to 9443 for Xray and edit it to 443 in the link you give your devices. Nullsify doesn't set up the nginx side for you.

Which one should you pick?

  • Just testing, or you only use the VPN at home? Option 1.
  • The website matters, or you want the least maintenance? Option 2.
  • One cheap server, and you're comfortable with nginx? Option 3.

Whichever you choose, the failure itself is explained on the address already in use page. To see what holds a port right now, run sudo ss -tlnp | grep ':443 '. For how Reality works and why it uses 443 at all, read what VLESS and Reality are, or follow how to set up VLESS with Reality.

Ready to run your own VPN?

Bring your own VPS and have VLESS, AmneziaWG, or WireGuard running in minutes — no manual setup required.