Welcome! Log In Create A New Profile

Advanced

redirect related questions...

ST
July 28, 2017 07:14AM
Hello,

I have several questions related to redirects:

Here is my setup:

server {
server_name www.example.org example.com; # and some more domains
return 301 $scheme://example.org$request_uri;
}

server {
listen 80;
server_name example.org;
...
if ($http_user_agent !~ facebookexternalhit/1.1) {
return 301 https://$host$request_uri;
}
}

server {
listen 443 ssl;
server_name example.org;
...
}

1. http://example.com redirects correctly to https://example.org (via
http://example.org), but not https://example.com - why?

2. neither http://www.example.org nor https://www.example.org redirect
to https://example.org (not even to http://example.org) - why?

How can I achieve that?

Thank you in advance!

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

redirect related questions...

ST July 28, 2017 07:14AM

Re: redirect related questions...

Francis Daly July 29, 2017 03:26PM

Re: redirect related questions...

ST July 30, 2017 05:14AM

Re: redirect related questions...

ST July 30, 2017 05:36AM

Re: redirect related questions...

ST July 30, 2017 05:58AM

Re: redirect related questions...

Francis Daly July 30, 2017 02:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready