• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Nginx Issue

bkhayes

Basic Pleskian
So I'm not the greatest at this yet, but I know enough to be dangerous. A few months back I attempted to install nginx page speed modules but I believe I've ended up installing nginx twice (for lack of knowledge). I know nginx is running as my site is running purely on nginx and not Apache.

But when I run "nginx -t" I get an error:
unknown directive "ssl_protocols" in /etc/nginx/conf.d/ssl.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

But when I run: "nginx server status" I get "active (running)" in green.

When running "nginx -V" I get:
nginx version: nginx/1.4.4
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
configure arguments: --add-module=/usr/local/nginx/modules/ngx_pagespeed-1.7.30.3-beta --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx

Something feels off even though the server is running fine. Can someone help to enlighten me on how to get back to to the defaults or guide me in a path toward getting pagespeed modules to function with nginx?

Thank you!
 
So I'm not the greatest at this yet, but I know enough to be dangerous. A few months back I attempted to install nginx page speed modules but I believe I've ended up installing nginx twice (for lack of knowledge). I know nginx is running as my site is running purely on nginx and not Apache.

But when I run "nginx -t" I get an error:
unknown directive "ssl_protocols" in /etc/nginx/conf.d/ssl.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

But when I run: "nginx server status" I get "active (running)" in green.

When running "nginx -V" I get:
nginx version: nginx/1.4.4
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
configure arguments: --add-module=/usr/local/nginx/modules/ngx_pagespeed-1.7.30.3-beta --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx

Something feels off even though the server is running fine. Can someone help to enlighten me on how to get back to to the defaults or guide me in a path toward getting pagespeed modules to function with nginx?

Thank you!

Hello,
the directive "ssl_protocols" isn't known by nginx because it seems nginx was not built with the http_ssl_module, and this release is really old (lastest nginx release is 1.15.4).
My recommendation is to remove this package (nginx package installed from apt is nginx, when plesk nginx package is sw-nginx) and to reinstall properly nginx package shipped with Plesk.
Then you should be able to compile nginx from source by following this excellent guide : Input - How to compile NGINX with additional modules ( pagespeed / cache_purge / headers-more / and others )
 
Thanks, virtubox. How do I go about removing the yum (apt-get doesn't work) installed nginx? Keep in mind I really am not good with code, so walking me through the process would be extremely helpful. Believe I'm running CentOS 7.

If I used: "yum remove nginx" would that work? Or would I be creating more problems?
 
Last edited:
If I used: "yum remove nginx" would that work? Or would I be creating more problems?
Try to get list of all dependences with running

# rpm -e --test nginx

you will see all related packages which should be removed to due to dependences.
 
What is output of command

# rpm -qa | grep nginx

Or you have nginx compiled manually?
 
Result of:

# rpm -qa | grep nginx

sw-nginx-1.13.8-centos7.18012914.x86_64

I believe I also have it complied manually?
 
When running "nginx -V" I get:
nginx version: nginx/1.4.4
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
configure arguments: --add-module=/usr/local/nginx/modules/ngx_pagespeed-1.7.30.3-beta --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx

I believe I also have it complied manually?

According to this information you really have custom compiled nginx with pagespeed module and binary located in /usr/local/sbin/nginx
 
Knowing this, how do I go about removing the custom compiled nginx with pagespeed module located in /usr/local/sbin/nginx?

Thank you!
-Ben
 
Was able to solve this by removing the files at /usr/local/sbin/nginx and reinstalling via yum (yum install nginx). I then ran plesk repair all -y. However this lead to another issue which was a 502 Bad Gateway but was able to solve it by using:

# usermod -a -G psaserv nginx

There was a permissions nginx error in the log file and I came across that command online. Used it and the 502 went away. Now when I run nginx -t I get:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

All of my sites are up and running on nginx with no more errors :)
 
Back
Top