About the author

joe@email.null'

Joe

Related Articles

One Comment

  1. 1
    Richard

    Richard Smith

    The value of the p argument is contained in the $arg_p variable. The if statement can be used to test the value of a variable. The actions available in an if block are limited (see this document for details), but a simple return statement is allowed.

    So the simplest solution would be to obliterate the query string from any URI which contains p=1, like this:

    server {
        ...
        if ($arg_p = 1) {
            return 301 $uri;
        }
        location / { ... }
    }
    

    Note that $uri is the normalised request URI, and is already missing the query string.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2017 SolutionMmyself.com