Failed to restart openresty. I would like to ask the correct order.

the path to install is
/ usr/local/openresty/nginx

Today, the nginx.conf file has been modified. It needs to be saved and restarted

execute: [root@newoneacreland ~]-sharp / usr/local/openresty/nginx-s reload

-bash: / usr/local/openresty/nginx: Is a directory

[root@newoneacreland ~]-sharp / usr/local/openresty/nginx/sbin/nginx-p pwd /-c conf/nginx.conf

nginx: [alert] could not open error log file: open () "/ root/logs/error.log" failed (2: No such file or directory)

could you tell me the correct way to restart?

Mar.02,2021

when you write the restart command, you don't use the executable file of nginx.

/usr/local/openresty/nginx -s reload
Change

to

/usr/local/openresty/nginx/sbin/nginx -s reload

of course, the above command takes effect only if your openresty has been started before you can reload .

error in the second command:

/usr/local/openresty/nginx/sbin/nginx -p `pwd`/ -c conf/nginx.conf

because you specified prefix as the current directory, you can see that your current directory is ~ , that is, the root user's home directory, that is, / root directory. You did not create the / root/logs directory for nginx in this directory, so an error was reported. If you don't care too much about this configuration item, just remove this parameter. By default, the prefix path of nginx will point to / usr/local/nginx/ . Of course, if you use openresty, you will point to / usr/local/openresty/nginx/ .

reference: official document-nginx Command Line

read the error message.

Menu