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?