HOME » Documents » KUSANAGI 9 Commands » httpd-behind-nginx

httpd-behind-nginx

httpd-behind-nginx

Switches to "httpd-behind-nginx" mode, which allows the web server and applications to run under Apache httpd but also uses the nginx functionality together by reverse proxying with NGINX. It will also restart the service.

Both Apache httpd and NGINX will run in this mode.
As with "nginx", both "fcache" and "ratelimit" will be available for use. Also, HTTP/3 is available starting with NGINX 1.25.1.
To change the NGINX version, run "httpd-behind-nginx" after changing the version with the "nginx" command.
Apache httpd WAF can be used.
To change the Apache version, run "httpd-behind-nginx" after changing the version with the "httpd" command.

Note that both Apache httpd and NGINX logs will be output, so be careful about the log volume in a high-load environment.
NGINX outputs to both HTTP and HTTPS access logs, but Apache httpd outputs only HTTP access logs.

*PST profiles are not compatible with "httpd-behind-nginx".
PST will be disabled by "httpd-behind-nginx". Also, WEXAL manager cannot be used.

Example

kusanagi httpd-behind-nginx
kusanagi httpd-behind-nginx --reload

Options

(No options)

If you are using "nginx" or "httpd", switches to "httpd-behind-nginx".
If "httpd-behind-nginx" has already started, restarts "httpd-behind-nginx".

Reloading Configuration

[--reload]

Reloads configuration without disconnecting the session.

Checking Configuration Files

[--test]

Checks the configuration files only.

Displaying Status

[--status]

Displays status of Apache httpd and Nginx.

Output

# kusanagi httpd-behind-nginx
nginx: the configuration file /etc/opt/kusanagi/nginx/nginx-with_httpd.conf syntax is ok
nginx: configuration file /etc/opt/kusanagi/nginx/nginx-with_httpd.conf test is successful
Removed /etc/systemd/system/multi-user.target.wants/nginx.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nginx@with_httpd.service -> /usr/lib/systemd/system/nginx@.service.
nginx completed.
Syntax OK
Created symlink /etc/systemd/system/multi-user.target.wants/httpd@with_nginx.service -> /usr/lib/systemd/system/httpd@.service.
httpd completed.
httpd-behind-nginx completed.