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

This questions has been asked many times on StackOverflow but my question differs a bit :

I have multiple sub domain websites :

As you can see, only admin is served through https.

I successfully created all my virtual hosts in Nginx and this works well.

But now, I would like to redirect all the clients that tries to access to other sub websites via https to http :

=> only admin does the opposite.

My first thought was to set each https domain with a redirect :

server {
    listen 443;

    rewrite         ^(.*)$1;

And did this for each subdomains (www, my and client).

But this don't work, I have an SSL error on my browser (SSL record too long).

How can I do that?

Thanks for your help!

share|improve this question
up vote 2 down vote accepted

You need to include all the ssl stuff for nginx in the server {}

You need at least

            ssl                  on;
            ssl_certificate      /etc/ssl/;
            ssl_certificate_key  /etc/ssl/;
share|improve this answer

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.