Nginx启动失败求助:未知指令proxy_ssl_server_name
What's Causing This?
The error message spells it out clearly: your Nginx version doesn’t recognize the proxy_ssl_server_name directive. This specific setting was added in Nginx 1.7.0, but you’re running nginx14 (the 1.4.x release series)—a version far too old to support it. That’s why the configuration test fails and the service refuses to start.
How to Fix It
You have two reliable options, depending on your needs:
Option 1: Remove/Comment the Unsupported Directive
If you don’t need the SNI (Server Name Indication) functionality that proxy_ssl_server_name enables, just adjust your nginx.conf file:
Find line 67 and comment it out like this:
# proxy_ssl_server_name on; # Your Nginx version doesn't support this line
Then test the configuration and restart the service:
/opt/rh/nginx14/root/usr/sbin/nginx -t systemctl start nginx14-nginx.service
Option 2: Upgrade Nginx to a Newer Version
If you do need SNI support for your HTTPS backend, you’ll have to upgrade Nginx to 1.7.0 or later. For your RHEL/CentOS-style environment:
- Set up the official Nginx repository and upgrade the package, replacing the old
nginx14installation - Or compile Nginx from source (make sure the
ngx_http_proxy_moduleis included—it’s enabled by default)
Once upgraded, verify the configuration and start the service:
nginx -t systemctl start nginx.service
Quick Note on proxy_ssl_server_name
This directive lets Nginx send the SNI header to HTTPS backend servers, which is only necessary if your backend uses SNI to route requests to multiple sites on the same IP. If your backend is a single site, Option 1 will work perfectly fine.
内容的提问来源于stack exchange,提问作者BalaB




