Getting started
Four steps, each reversible. Nothing touches your running server until step 4.
1. Install
One line. It detects your distribution, enrols the signed package repository and installs from it, so ordinary system upgrades keep working afterwards:
curl -fsSL https://xinproxy.com/install.sh | sh
Pass --dry-run to print every command it would execute without
running any of them, or --product xin-gateway for the
Kubernetes controller. The script is served as plain text — read it first
if you like: xinproxy.com/install.sh.
The package starts nothing. Installing xin does not start a service, does not enable one at boot, and does not modify or stop your nginx installation. Installing it on a production web server is inert.
Prefer to add the repository by hand? See Releases.
2. Read your existing configuration
xin's default configuration path is /etc/nginx/nginx.conf —
the file you already have. This reads it in place, converts nothing, and
writes nothing:
xind -t -c /etc/nginx/nginx.conf A clean result looks like this:
xind: the configuration file /etc/nginx/nginx.conf syntax is ok
xind: configuration file /etc/nginx/nginx.conf test is successful That means xin has a complete interpretation of your configuration. If instead it refuses something, that is the product working — the refusal names the file, the line and the reason:
bad.conf: configuration failed:
bad.conf:2:15: limit_conn: limit_conn is not supported Every problem is reported, not just the first, so one run tells you the whole distance between your config and a working xin. See Configuration compatibility for what is supported and what is refused.
3. Run it on a spare port
Before touching port 80, prove it serves. Copy your config, change the
listen port, and run it in the foreground:
sed 's/listen 80;/listen 8080;/' /etc/nginx/nginx.conf > /tmp/xin-test.conf
xind -c /tmp/xin-test.conf
# in another shell
curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/ Compare responses against your live server — headers included — until you are satisfied they match.
4. Cut over
xin and nginx both want port 80, so one has to stop before the other starts. That ordering is the whole cutover:
sudo systemctl stop nginx
sudo systemctl enable --now xin
systemctl status xin Rolling back is the same two commands in the other order:
sudo systemctl stop xin
sudo systemctl start nginx Reloads are not yet loss-free. A configuration reload
under sustained load drops on the order of 2 requests in 140,000 through
our own harness, where nginx drops none. Binary upgrade in place
(-s reload semantics via USR2) works, but
systemd does not follow the pid change, so under the packaged unit the
supported upgrade is a restart. If you cannot afford either, drain the
host at your load balancer first.
A host with no nginx at all
If there is no /etc/nginx/nginx.conf to read, the packages
ship a minimal standalone config at /etc/xin/xin.conf. Nothing
reads it unless you point at it — set XIN_CONF in
/etc/default/xin (Debian) or /etc/sysconfig/xin
(RPM) and restart the service.
musl (static tarball) only: musl's getpwnam
reads /etc/passwd and nothing else, so a user
directive naming an account that comes from SSSD, LDAP or another NSS
source will not resolve. Use the glibc packages on hosts with
directory-backed accounts.