| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template used to generate a cache bypass nginx.conf for when a user disables nginx caching. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
$nginx = <<<RULES |
| 11 |
# BEGIN KadencePerformanceNginxBypassRules |
| 12 |
# This should be included in the server{} block of your vhost. |
| 13 |
# This file is automatically generated. Do no edit. Use the `solidwp/performance/nginx/bypass/rules` filter. |
| 14 |
|
| 15 |
# Deny direct access to the Kadence Performance swpsp-nginx.conf. |
| 16 |
location ~ swpsp-nginx\.conf$ { |
| 17 |
deny all; |
| 18 |
} |
| 19 |
|
| 20 |
# Nginx caching has been disabled via settings, provide a location fallback. |
| 21 |
location / { |
| 22 |
try_files \$uri \$uri/ /index.php?\$args; |
| 23 |
} |
| 24 |
# END KadencePerformanceNginxBypassRules |
| 25 |
|
| 26 |
RULES; |
| 27 |
|
| 28 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, StellarWP.XSS.EscapeOutput.OutputNotEscaped |
| 29 |
echo apply_filters( 'solidwp/performance/nginx/bypass/rules', $nginx ); |
| 30 |
|