This can be done by establishing the listening port external to nginX and then using the "NGINX" environment variable to pass the file descriptor to nginX, e.g.:
NGINX="3;" nginx
You need to specify the "listen" clause(s) using the same address as was established for the listening port, e.g.:
http {
server {
listen [::]:53124;
}
}
Notes:
This mechanism is undocumented (quite deliberately, it would appear), but is widely used for systemd-based launches.
The use of the NGINX environment variable implies daemon=off.
One reason you might want to do this sort of thing is to be able to run a number of nginX instances in parallel to perform tests in isolation from each other.
NGINX="3;" nginx
You need to specify the "listen" clause(s) using the same address as was established for the listening port, e.g.:
http {
server {
listen [::]:53124;
}
}
Notes:
This mechanism is undocumented (quite deliberately, it would appear), but is widely used for systemd-based launches.
The use of the NGINX environment variable implies daemon=off.
One reason you might want to do this sort of thing is to be able to run a number of nginX instances in parallel to perform tests in isolation from each other.