'-s reload' doesn't work in 'master_process off'?

My issue:

I have a small embedded project that uses nginx as web server.

There is no high-load and resource is strain. so my config is like

user  root;
master_process off;
worker_processes 1;
...

There are some special reasons that I hope nginx only starts master and no worker, so that I config ‘master_process off‘.work is ok except for ‘reload’.

How I encountered the problem:

sudo ./nginx -p /tmp/nginx

curl http:// localhost:1111 # is work

sudo /tmp/nginx/sbin/nginx -p /tmp/nginx -s reload # reload config

curl http:// localhost:1111 # is NG, error.log with debug said ‘2025/11/17 11:07:46 [alert] 50959#50959: 1024 worker_connections are not enough‘

Solutions I’ve tried:

modify nginx.conf

master_process on;

It’s work.

Version of NGINX or NGINX adjacent software (e.g. NGINX Gateway Fabric):

1.27.4

Deployment environment:

Minimal NGINX config to reproduce your issue (preferably running on https://tech-playground.com/playgrounds/nginx for ease of debugging, and if not as a code block): (Tip → Run nginx -T to print your entire NGINX config to your terminal.)

NGINX access/error log: (Tip → You can usually find the logs in the /var/log/nginx directory.)

error.log (26.7 KB)

no proxy process, ‘192.168.153.130:1111’ is 502, no problem.

but after ‘reload‘, is no work anymore.

Hi @wweeee!

By setting master_process off; you are effectively telling NGINX to not be run as a service and not master PID will be created. This, in turn, will mean that nginx -s reload will not work since there is no service to reload. If you read our docs you will also see that we suggest not tweaking this directive unless you are a developer.

As far as I know, there is no way to launch the master process and no worker processes due to the way NGINX is architected. For your use case I think not touching master_process and setting worker_processes 1; is the way to go.

Hope that helps!

1 Like

thx for reply!
I will carefully consider all of configs

1 Like