Whitelist in GridPane NGINX wp-pdf plugin uploads

It is common to get 403 if you upload a file and embed a pdf within the plugin wp-pdf.

You can easily remove this 403 warning by editing this file:

nano /etc/nginx/extra.d/bad-request-whitelist-7g-context.conf

and adding the following code:

set $exclusion_rule_match "";
if ( $args ~* (&|^)download=off&index=\d+&pdfID=\d+ ) {
    set $exclusion_rule_match 15;
}
if ($bad_request_7g = $exclusion_rule_match) {
    set $7g_drop_bad_request 0;
}

Then do a check to syntax with nginx -t and reload the new file to nginx with this command gp ngx reload