nginx erroneously redirecting to https

Piki nginx-forum at
Sun Oct 7 13:42:37 UTC 2012

Piki Wrote:
> I am running nginx+php-fpm on localhost for testing some stuff sites
> before uploading to a live server (which I have done with nginx in the
> past), and have run into the first issue which Google can't seem to
> help me with:
> I have decided to try three different forum softwares. They are
> installed under separate subdirectories within my web root (e.g.
> /srv/www/localhost/html/{forum1,forum2,forum3}). On two of the forums,
> however, whenver I try to use anything that requires a password, it
> switches from http to https, and on one of the forums, attempts to
> continue using port 80. On the forum that it attempts to use port 80,
> I get the following error message:
> ----------code snippet----------
> Secure Connection Failed
>           An error occurred during a connection to localhost:80.
> SSL received a record that exceeded the maximum permissible length.
> (Error code: ssl_error_rx_record_too_long)
>   The page you are trying to view cannot be shown because the
> authenticity of the received data could not be verified.
>   Please contact the website owners to inform them of this problem.
> Alternatively, use the command found in the help menu to report this
> broken site.
> ----------end code snippet----------
> I do not have https or ssl configured within nginx or the vhost, nor
> any ssl certs.
> Here is the vhost config file:
> ----------code snippet----------
> server {
>         server_name localhost;
>         listen 80;
>         root /srv/www/localhost/html;
>         index index.php index.html index.htm;
>         ssi on;
>         location ~ \.php$ {
>                 include /etc/nginx/fastcgi_params;
>                 fastcgi_index index.php;
>                 fastcgi_pass;
>         }
> }
> ----------end code snippet----------

This issue seems to have fixed itself after I added the "ssl off;" directive
(without quotes) to the above server block. After I restarted nginx, I
cleared out and reinstalled the affected forum software, and the issue
hasn't reappeared yet, not even after clearing my browser cache, rebooting
the computer, then revisiting the forums.

I though "ssl off;" was supposed to be the default if the ssl setting isn't

Posted at Nginx Forum:,231379,231455#msg-231455

More information about the nginx mailing list