Welcome! Log In Create A New Profile

Advanced

Re: Problems with redirects

October 15, 2019 08:56AM
Hi Danny,

two comments:

1) Don't forget about $is_args$args to also pass any arguments supplied with the URL.

2) You cannot redirect requests with a request body, most importantly POST and PUT, so your rule is only applicable for GET/HEAD requests.

I have no idea what you are really struggling with as you don't mention the actual challenge.

Regarding your server block:

- "listen 80 default_server;" is sufficient.

- You can specify server names, but your intention is to forward everything, so you may as well omit it or write a dummy such as "server_name _;"

- You may want to add a different redirection if the request method is not GET (or HEAD), so users will end up on the home page or somewhere else meaningful and not have to face a funny error message the won't understand, because a POST/PUT request did not specify a body.

Regarding the https service:

- If you use one IP address to serve multiple domains, get a SAN certificate with all domain names added. This way, you can avoid using SNI.

Cheers,

--j.
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: 245
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