ssl redirect issue

Adam Tistler atistler at
Thu Sep 22 09:17:18 UTC 2011


I have an ssl nginx setup which was working fine with one server { ssl on }.  However I have legacy ssl server_names that I would like to have a 'catch all' for that should be redirected back to the 'main' ssl server name.  Config is pasted here.      ( I removed some sections for brevity )

When the following lines are enabled:

    server {
        listen 443 default;
        server_name _;
        rewrite ^(.*)$1 permanent;

I will get:

SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)

If i comment those lines out, the request will go thru just fine.  However since:

    server {
        listen 443;

is treated as the default vhost,  even ssl requests for are serviced by this server {} and are not redirected to (obviously not what I want).

Thanks for the help in advanced.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list