Skip to content

Commit e848d76

Browse files
committed
Change code order to enable/disable debug
1 parent 8a072eb commit e848d76

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rocket-nginx.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ if (!-f "$rocket_file") {
7272
set $rocket_reason "File not cached";
7373
}
7474

75-
# If the bypass token is still on, rewrite according to the file linked to the request
75+
# If the bypass token is still on, let's bypass WordPress with the cached URL
7676
if ($rocket_bypass = 1) {
7777
set $rocket_is_bypassed "Yes";
7878
set $rocket_reason "$rocket_url";
79-
rewrite .* "$rocket_url" last;
8079
}
8180

8281
# Clear variables if debug is not needed
@@ -85,6 +84,12 @@ if ($rocket_debug = 0) {
8584
set $rocket_reason "";
8685
}
8786

87+
# If the bypass token is still on, rewrite according to the file linked to the request
88+
if ($rocket_bypass = 1) {
89+
rewrite .* "$rocket_url" last;
90+
}
91+
92+
8893
# Add header to HTML cached files
8994
location ~ /wp-content/cache/wp-rocket/.*html$ {
9095
add_header Vary "Accept-Encoding, Cookie";

0 commit comments

Comments
 (0)