Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx, how to start service with ngx_http_sub_module enabled

How to start Nginx as service with this module?

According to this documentation, it says:

This module is not built by default, it should be enabled with the --with-http_sub_module configuration parameter.

I don't understand where to enter this command. Is it nginx service start --with-http_sub_module? That is so confusing.

When I enter nginx -V it shows that --with-http_sub_module is available.

like image 488
Mr.D Avatar asked Mar 05 '19 13:03

Mr.D


1 Answers

If you see --with-http_sub_module in nginx -V output, you can be certain that the module is already built in. So simply use its directives in configuration file, there is no need to do any special magic to load the module itself.

Now as to why documentation says:

This module is not built by default, it should be enabled with the --with-http_sub_module configuration parameter.

This applies to when you compile nginx yourself, e.g. run the standard ./configure && make && make install. So the module is not installed by default if you run ./configure without arguments.

But its worth noting that most packaged nginx builds (ones that you get from yum install nginx or e.g. apt install nginx) would have custom ./configure command, which (as in your case) already likely had the --with-http_sub_module as one of the configuration switches.

like image 167
Danila Vershinin Avatar answered Oct 11 '22 12:10

Danila Vershinin