0

Currently I am installing a new server with Nginx. Additionally I want to add the Google Pagespeed Module and SSL support. However it seems my Nginx build does not recognize it is build with the ngx_http_ssl_module. These are the steps I took to build nginx with these modules.

Configure the Nginx build:

./configure --add-module=/path/to/pagespeed_module --with-http_ssl_module

Make my build:

> make

...
Configuration summary
  + using system OpenSSL library
  ...

Install build:

> make install

...
objs/src/http/modules/ngx_http_ssl_module.o \
...

Having vhost:

server {
    listen 443 ssl;

    root /path/to/application;
    index index.php index.html index.htm;

    server_name my.domain.com;

    # SSL
    # ---
    ssl on;
    ssl_certificate /path/to/certificate.crt;
    ssl_certificate_key /path/to/certificate.key;
    keepalive_timeout 70;

    ...
}

Reload:

> nginx -s reload

Check config:

> nginx -t

nginx: the configuration file /path/to/config syntax is ok
nginx: configuration file /path/to/config test is successful

Check version:

> nginx -V

nginx version: nginx/1.13.6
built by gcc 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
built with OpenSSL 1.0.2g  1 Mar 2016
TLS SNI support enabled
configure arguments: --add-module=/path/to/pagespeed_module --with-http_ssl_module

Check error log:

the "ssl" parameter requires ngx_http_ssl_module in /path/to/vhost

The only error given through this process is when I restart my nginx with the new build. I have tried to make a build without the pagesped module, building clean and adding the module afterwards: but no success.

Suggestions on where to check when this error appears would be more than welcome.

Edit - Answer on what distribution

> lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty
  • Are you sure the correct nginx binary is being started by you/init script ? maybe start manually with full path – Sandor Marton Nov 29 '17 at 21:17
  • Try to remove ssl on; because you already enabled ssl in the listen directive. What distro are you using? – ALex_hha Nov 29 '17 at 22:06
  • Thanks for your reply, sorry for my delayed answer. @SandorMarton I have tried starting nginx with full path, still the same error. – Thomas Van der Veen Dec 05 '17 at 19:34
  • Thanks for your reply, sorry for my delayed answer. @ALex_hha You are [right](http://nginx.org/en/docs/http/ngx_http_ssl_module.html). However I can see now this is making the error (forgot to look at lin 17 as said in my error). When I remove it and enable `ssl on;`, it gives me the following error: ` unknown directive "ssl"`. – Thomas Van der Veen Dec 05 '17 at 19:58
  • 1
    You did a reload of the Nginx configuration rather than a restart of the service. I have a tutorial on building Nginx [here](https://www.photographerstechsupport.com/tutorials/hosting-wordpress-on-aws-tutorial-part-2-setting-up-aws-for-wordpress-with-rds-nginx-hhvm-php-ssmtp/#nginx-source). – Tim Dec 05 '17 at 19:59
  • I managed to fix the issue. Thanks @Tim pushing me to the right direction. The issue was fixed by adding a [Nginx service file](https://www.nginx.com/resources/wiki/start/topics/examples/systemd/) and restarting with that. Looks like `nginx -s reload` does not reload the entire service. – Thomas Van der Veen Dec 05 '17 at 20:29

0 Answers0