jan
NGINX Map WITHOUT Rewrite
September 15, 2015 07:10PM
Hi All,

I'm new to the forum and new to NGINX and trying to get all my old Apache settings to work ...

I have the following issue: I want to use a map to rewrite the uri but I don't want it to (visually) redirect.

These lines all work, but I don't want to see the redirect.
if ($new) {
# return 301 \?$new;
# rewrite ^ /?$new? redirect;
rewrite ^ /?$new? permanent;
}

For some reason I can not get this to work:
if ($new) {
# rewrite ^ /?$new? last;
rewrite ^ /?$new? break;
# rewrite ^(.*) /?$new? last;
}

I have searched for hours but can not find or understand the solution. Any helpwould be greatly appreciated!!

Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 229
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