Welcome! Log In Create A New Profile

Advanced

Get rid of args from $request_uri

August 08, 2017 05:42AM
Hi

I want to build a construction like

location ~* {
if ($args ~ *) {
add_header Link "<$scheme://$http_host$request_uri>; rel=\"canonical\"";
}
}
but need to get rid of argues from $request_uri. The goal is from any url with parameters to point with canonical auf non-parameter url counterpart. I've realized a method to get rid of argues from $request_uri, like this:

map $request_uri $request_uri_path {
"~^(?P<path>[^?]*)(\?.*)?$" $path;
}

I Need an advice - how are both snippets to put together?
Subject Author Posted

Get rid of args from $request_uri

chilly_bang August 08, 2017 05:42AM

Re: Get rid of args from $request_uri

c0nw0nk August 08, 2017 08:45AM

Re: Get rid of args from $request_uri

chilly_bang August 08, 2017 10:02AM

Re: Get rid of args from $request_uri

tokers August 08, 2017 10:08AM

Re: Get rid of args from $request_uri

Lucas Rolff August 08, 2017 11:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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