nginx
Switches the web server you are using to nginx. It will also restart the service.
In Security Edition, switches the web server you are using to "nginx reverse proxy + nginx", where the NGINX handles reverse proxying, and both the Web server and applications run on the separate NGINX. It will also restart the service.
For details on the differences between Web servers, please refer to the KUSANAGI Web Server Configurations or the KUSANAGI Security Edition Web Server Configurations.
Example
kusanagi nginx --use nginx129
kusanagi nginx
Options
(No options)
If you are using "httpd", it will switch to "nginx".
If "nginx" is already running, "nginx" will restart.
In Security Edition, if you are using "nginx reverse proxy + httpd", it will switch to "nginx reverse proxy + nginx".
If "nginx" is already running, "nginx reverse proxy + nginx" will restart.
NGINX Version
[--use {installed | nginx129 | nginx128}]
Discontinued options
--use nginx127 (discontinued as of 9.8.1 and 10.3.1)
--use nginx126 (discontinued as of 9.8.1 and 10.3.1)
--use nginx125 (discontinued as of 9.6.8 and Security Edition)
--use nginx124 (discontinued as of 9.6.8 and Security Edition)
--use nginx123 (discontinued as of 9.4.5)
--use nginx122 (discontinued as of 9.4.5)
--use nginx121 (discontinued as of 9.2.10)
--use nginx120 (discontinued as of 9.2.10)
--use nginx119 (discontinued as of 9.0.12)
--use nginx118 (discontinued as of 9.0.12)
Default: installed
Specifies the version of NGINX to be used. When one of the following NGINX is specified, it will start up.
In Security Edition, specifies the version of NGINX to be used. When one of the following NGINX is specified, it will start up.
The same version of NGINX is used for reverse proxying and Web server/applications.
To specify different versions of NGINX, use kusanagi proxy command.
If multiple versions of NGINX is already running, this option is mandatory.
"--use", "--reload", "--test", "--update-conf", "--status" and "--showpath" cannot be specified at the same time.
- --use installed: NGINX currently installed
- --use nginx129 : NGINX 1.29
- --use nginx128 : NGINX 1.28
- --use nginx127 (discontinued as of 9.8.1 and 10.3.1) : NGINX 1.27
- --use nginx126 (discontinued as of 9.8.1 and 10.3.1) : NGINX 1.26
- --use nginx125 (discontinued as of 9.6.8 and Security Edition) : NGINX 1.25
- --use nginx124 (discontinued as of 9.6.8 and Security Edition): NGINX 1.24
- --use nginx123 (discontinued as of 9.4.5) : NGINX 1.23
- --use nginx122 (discontinued as of 9.4.5) : NGINX 1.22
- --use nginx121 (discontinued as of 9.2.10) : NGINX 1.21
- --use nginx120 (discontinued as of 9.2.10) : NGINX 1.20
- --use nginx119 (discontinued as of 9.0.12) : NGINX 1.19
- --use nginx118 (discontinued as of 9.0.12) : NGINX 1.18
Reloading Configuration
[--reload]
Reloads configuration without disconnecting the session.
"--use", "--reload", "--test", "--update-conf", "--status" and "--showpath" cannot be specified at the same time.
Checking Configuration File
[--test]
Checks the configuration files only.
"--use", "--reload", "--test", "--update-conf", "--status" and "--showpath" cannot be specified at the same time.
Update Configuration File
Discontinued options
[--update-conf (discontinued as of Security Edition)]
Updates the configuration file to match the NGINX 1.25.1 specifications.
"--use", "--reload", "--test", "--update-conf" and "--status" cannot be specified at the same time.
Displaying Status
[--status]
Displays status of NGINX.
"--use", "--reload", "--test", "--update-conf", "--status" and "--showpath" cannot be specified at the same time.
Displaying Full Path of nginx Command
[--showpath]
Displays the full path of nginx command.
"--use", "--reload", "--test", "--status" and "--showpath" cannot be specified at the same time.
Output
# kusanagi nginx
nginx: the configuration file /etc/opt/kusanagi/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/opt/kusanagi/nginx/nginx.conf test is successful
Removed /etc/systemd/system/multi-user.target.wants/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service -> /usr/lib/systemd/system/nginx.service.
nginx completed.
In case of Security Edition:
# kusanagi nginx
nginx: the configuration file /etc/opt/kusanagi/nginx129/nginx-proxy.conf syntax is ok
nginx: configuration file /etc/opt/kusanagi/nginx129/nginx-proxy.conf test is successful
nginx: the configuration file /etc/opt/kusanagi/nginx129/nginx-production.conf syntax is ok
nginx: configuration file /etc/opt/kusanagi/nginx129/nginx-production.conf test is successful
Removed "/etc/systemd/system/multi-user.target.wants/httpd24@production.service".
Created symlink /etc/systemd/system/multi-user.target.wants/nginx129@production.service -> /usr/lib/systemd/system/nginx129@.service.
nginx completed.