Redirect https:// to https://www produce untrusted connection

Hi,

I’m running a website with nginx as a proxy and for static files.
I’m using the ubuntu lucid nginx package - version 0.7.65
http://example.com redirect to http://www.example.com - works
https://www.example.com - SSL works
https://example.com redirect to https://www.example.com - doesn’t work
and
show untrusted connection in the browser.

I have two questions:

  • Why SSL only works when I use default on the listen: “listen 443
    default;”
  • Why I can’t redirect https:// to https://www before I’m getting the
    untrusted connection warning.

Thanks

My config file:
server {
listen 80;
server_name example.com.com;
rewrite ^/(.*) http://www.example.com/$1 permanent;
}

server {
listen 80;
server_name www.example.com;

location / {
    proxy_pass http://127.0.0.1:8000;
}

...

}

server {
listen 443;
server_name example.com.com;
rewrite ^/(.*) https://www.example.com.com/$1 permanent;
}

server {
listen 443 default;

ssl    on;
ssl_certificate    /etc/nginx/ssl/example.pem;
ssl_certificate_key    /etc/nginx/ssl/example.key;

server_name  www.example.com;

location / {
    proxy_pass http://127.0.0.1:8000;
}
...

}

On Sun, May 09, 2010 at 11:35:23PM +0300, pablo platt wrote:

  • Why SSL only works when I use default on the listen: “listen 443
    default;”

Please read this:

http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
http://nginx.org/en/docs/http/configuring_https_servers.html

  • Why I can’t redirect https:// to https://www before I’m getting the
    untrusted connection warning.

http://nginx.org/en/docs/http/configuring_https_servers.html#certificate_with_several_names


Igor S.
http://sysoev.ru/en/

I still can’t redirect https:// to https://www but maybe I need the
certificate to support https:// for this to work.

Thanks

On Mon, May 10, 2010 at 02:01:16PM +0300, pablo platt wrote:

I still can’t redirect https:// to https://www but maybe I need the
certificate to support https:// for this to work.

Yes, you need the certificate for example.com.

http://example.com redirect to http://www.example.com - works


Igor S.
Igor Sysoev


nginx mailing list
[email protected]
nginx Info Page


nginx mailing list
[email protected]
nginx Info Page


Igor S.
http://sysoev.ru/en/