ERR_SSL_PROTOCOL_ERROR Caused by unsupported NGINX Configuration Format
If your website displays a ERR_SSL_PROTOCOL_ERROR message, then the issue may be caused by the format of the NGINX configuration.
Our Config Parser currently supports only one specific NGINX configuration format. If the configuration is written differently, even if the NGINX configuration itself is valid, our parser will not be able to detect it.
When the configuration cannot be detected, we are unable to collect the SSL certificate. As a result, the website may return an ERR_SSL_PROTOCOL_ERROR.
Supported NGINX Configuration Format#
Currently, the only supported format is:
server {
listen 80;
server_name *.priceninja.dev priceninja.dev;
location / {
return 301 https://$host$request_uri;
}
}
The directives must be structured as shown above so that our Config Parser can parse the configuration correctly.
Unsupported Configuration Format#
For example, the following configuration is not supported:
server {
listen 80;
server_name *.priceninja.dev priceninja.dev;
location / { return 301 https://$host$request_uri; }
}
Although this configuration may be valid from an NGINX perspective, the location block and return directive are written on a single line.
Our current Config Parser cannot detect this format.
Why Does This Cause an SSL Error?#
Our system relies on the NGINX configuration parser to identify the relevant configuration and collect the SSL certificate.
If the configuration does not match the currently supported format:
-
Our parser cannot detect the configuration.
-
The SSL certificate cannot be collected.
-
The SSL configuration cannot be completed correctly.
-
The website may return an
ERR_SSL_PROTOCOL_ERROR.
How to Fix the Issue#
Update the NGINX configuration to follow the supported format.
Before#
server {
listen 80;
server_name *.priceninja.dev priceninja.dev;
location / { return 301 https://$host$request_uri; }
}
After#
server {
listen 80;
server_name *.priceninja.dev priceninja.dev;
location / {
return 301 https://$host$request_uri;
}
}
After updating the configuration, it is highly advisable to reload NGINX. Following that, we strongly recommend using NGINX's built-in configuration validation to ensure that the new configuration is correct.
You can do this with the command: nginx -t