diff --git a/CHANGELOG.md b/CHANGELOG.md index 454f858..d72c562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [3.1.1] - 2020-05-22 + +### Added + +* Prerender cdn file postfix that is adding through config param. + +### Changed + +None. + +### Removed + +None. + ## [3.1.0] - 2020-05-21 ### Added diff --git a/configuration/defaults/___server.yaml b/configuration/defaults/___server.yaml index c52b250..3ed124f 100644 --- a/configuration/defaults/___server.yaml +++ b/configuration/defaults/___server.yaml @@ -24,6 +24,7 @@ defaults: queryParams: [] # params that will be passed to CDN to find files. Params are sorted alphabetically. cdnUrl: null # CDN url cdnPath: / # CDN folder relative to root path with trailing slash (/) + cdnFilePostfix: null url: null # Proxy pass URL for bots, with schema. resolver: "8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1" # nginx "resolver" option to force DNS resolution and prevent caching of IPs headers: [] # Authorization headers (or others), format: key - $headerName, value - $headerValue diff --git a/src/Handler/NginxHandler.php b/src/Handler/NginxHandler.php index 594f61c..92388a5 100644 --- a/src/Handler/NginxHandler.php +++ b/src/Handler/NginxHandler.php @@ -85,6 +85,7 @@ public function generateConfig(HeaderInterface $header): void 'prerenderQueryParams' => $this->getSorted('server.prerender.queryParams'), 'CDNUrl' => $this->getParamWithoutTrailingSlash('server.prerender.cdnUrl'), 'CDNPath' => $this->getParamWithoutTrailingSlash('server.prerender.cdnPath'), + 'CDNFilePostfix' => $this->configuration->get('server.prerender.cdnFilePostfix', null), 'prerenderHeaders' => $this->configuration->get('server.prerender.headers', []), 'prerenderResolver' => $this->configuration->get('server.prerender.resolver', false), 'headers' => $header->convert($this->configuration), @@ -159,8 +160,8 @@ private function getParamWithoutTrailingSlash(string $key) } /** - * @param string $key - * @param array $default + * @param string $key + * @param array $default * * @return bool|string */ diff --git a/src/Handler/templates/nginx_default.conf.php b/src/Handler/templates/nginx_default.conf.php index 144d6e2..16826d9 100644 --- a/src/Handler/templates/nginx_default.conf.php +++ b/src/Handler/templates/nginx_default.conf.php @@ -310,7 +310,7 @@ if ($prerender = 1) { #setting prerender as a variable forces DNS resolution since nginx caches IPs and doesnt play well with load balancing - rewrite .* $req_uri$q break; + rewrite .* $req_uri$q break; proxy_pass ""; break; }