0

I have several domain names, and I want redirect all of them to https://indi-ticket.fr

I have configured Nginx and all the request from http://other-domain.xx are redirected to htpps://indi-ticket.fr but not these from https://other-domain.xx.

Here is the relevant part of my Nginx conf:

server {
        listen         80;
        server_name
                www.indi-ticket.fr
                indi-ticket.fr
                www.indi-tickets.fr
                indi-tickets.fr
                www.indi-ticket.com
                indi-ticket.com;
        return 301 https://indi-ticket.fr$request_uri;
}

server {
    listen 443 ssl;
    server_name indi-ticket.fr;

    ssl on;
    ...

What is wrong with this conf? What curl -I -L https://indi-tickets.fr does not redirect to https://indi-ticket.fr?

Simon
  • 137
  • 1
  • 5

1 Answers1

1

https://indi-tickets.fr is using HTTPS, which means it's hitting port 443, not port 80. Your port 443 config doesn't do any redirecting. It's possible to have a combined server block that handles both.

ceejayoz
  • 32,910
  • 7
  • 82
  • 106
  • 1
    Note that without including the appropriate key information in the `server` block or having a wildcard cert for the server, browsers will stop on untrusted warnings. I believe the redirect is sent after negotiation. – Paul Nov 08 '16 at 15:43