Overview
If a legitimate page on a GridPane site returns a 403 Forbidden, the 7G firewall may be matching a word in its URL. The fix is a small whitelist file in /etc/nginx/extra.d/. Don’t edit the core 7G rules.
This article is for site admins with SSH access to a GridPane server. It takes about 5 minutes.
Why it happens
GridPane’s 7G firewall is a set of nginx map blocks. Each one tests one part of the request against case-insensitive regex patterns. Most patterns match anywhere in the text, so a harmless word can trigger them.
| Map | What it checks |
|---|---|
$bad_bot_7g | The User-Agent header |
$bad_referer_7g | The Referer header |
$bad_querystring_7g | The query string (after ?) |
$bad_request_7g | The full request URI (the path) |
Example. The product URL /product/boards-of-canada-inferno-2-x-vinyl-lp/ was blocked by rule 5 of $bad_request_7g:
"~*(/)(vbulletin|boards|vbforum)(/)?" 5;
This rule targets forum-software probes like /boards/. The trailing slash (/)? is optional, so any path segment starting with /boards matches, including /boards-of-canada.
Step 1: Find the rule that blocks the request
- Confirm the block. Open the URL in a private window and check that it returns 403. Check that a similar URL without the suspect word loads normally.
- Find the 7G mappings file on the server and list the patterns in each map:
grep -rl "bad_request_7g" /etc/nginx/ - Compare the URL path with the
$bad_request_7gpatterns first. Look for any keyword that appears inside the path, even as part of a longer word (boardsinsideboards-of-canada). - If the path is clean, check the query string, User-Agent and Referer maps the same way.
- Note the map name and the matching keyword. You need both for the whitelist.
Step 2: Create a whitelist file
Each 7G map loads custom files from /etc/nginx/extra.d/ before its built-in rules. nginx uses the first regex that matches, so a rule with value 0 there lets the request through.
Pick the file name ending that matches the map you found:
| Map | File name must end with |
|---|---|
$bad_request_7g | 7g-bad-request-context.conf |
$bad_querystring_7g | 7g-bad-querystring-context.conf |
$bad_bot_7g | 7g-bad-bot-context.conf |
$bad_referer_7g | 7g-bad-referer-context.conf |
For the example above, create /etc/nginx/extra.d/discobole-7g-bad-request-context.conf:
nano /etc/nginx/extra.d/discobole-7g-bad-request-context.conf
Add one line per allowed pattern:
"~*(/product/boards-)" 0;
This allows only product URLs that start with boards-. Forum probes like /boards/ stay blocked.
Step 3: Test and reload nginx
- Check the configuration for syntax errors:
nginx -t - If the test passes, reload nginx:
gp ngx reload - Open the blocked URL again in a private window. It should now load normally.
- Request a forum probe such as
/boards/to confirm it still returns 403.
If nginx -t fails, check the quotes and the closing ; in your file. Fix the file before you reload.
Best practices
- Don’t edit the core 7G file. GridPane can overwrite it on updates, and your change would disappear.
- Keep the whitelist narrow. Match the specific path prefix (
/product/boards-), not the bare keyword (boards). - Use one file per site. Start the file name with the site name so you can find and remove it later.
- Add a comment above each rule with the reason and the date, for example
# Allow product slugs starting with boards- (2026-10-25). - Retest after GridPane updates. Rule numbers and patterns can change between 7G versions.