Welcome! Log In Create A New Profile

Advanced

Re: Problems with redirects

Danny Horne
October 15, 2019 10:02AM
On 15/10/2019 14:08, Reinis Rozitis wrote:
>> The problem is, whatever URL I put in the browser, it redirects to
>> https://trisect.uk _______________________________________________
>> server_name trisect.uk *.trisect.uk;
>> return 301 https://$server_name$request_uri; }
> For that I don't think you can use $server_name here because it will always be the first one picked no matter if the client passes site1.trisect.uk in Host header.
>
> Try with return 301 https://$host$request_uri;
>
> rr

Ok, I think I'm there with the following server block, I think the main
problem was that I'd shot myself in the foot by using 301 redirects,
which Chrome was caching, testing with another browser showed everything
working as desired.  Clearing the Chrome redirect cache has (I think)
fixed it.

server {
        listen *:80;
        listen [::]:80;

        server_name trisect.uk *.trisect.uk;

        return 301 https:/$host$request_uri;
}

Thanks for all replies

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

Problems with redirects

Danny Horne October 15, 2019 08:42AM

Re: Problems with redirects

j94305 October 15, 2019 08:56AM

Re: Problems with redirects

Danny Horne October 15, 2019 09:02AM

RE: Problems with redirects

Reinis Rozitis October 15, 2019 09:10AM

Re: Problems with redirects

Danny Horne October 15, 2019 10:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready