Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have SSL-sertificate for www.
How is the right config for nginx to get desired:

  • SSL request without www ( will be redirected to https://www.

This doesn't work, broser shows SSL-warning (wrong domain) :(

        listen  443 ssl;
        rewrite ^(.*)$1 permanent;
        ssl_certificate      intermediate.crt;
share|improve this question
up vote 0 down vote accepted

Since ssl handshake and certificate check occurs before any HTTP communication there is no way to make redirect without browser's warning.

share|improve this answer
Apart from getting another certificate for the second domain. – Ladadadada Nov 29 '11 at 9:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.