"Fossies" - the Fresh Open Source Software Archive

Member "incubator-pagespeed-mod-1.14.36.1/html/doc/filter-domain-rewrite.html" (28 Feb 2020, 3261 Bytes) of package /linux/www/apache_httpd_modules/incubator-pagespeed-mod-1.14.36.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the incubator-pagespeed-mod-1.14.36.1.tar.gz project site itself.

Rewrite Domains

Configuration

The 'Rewrite Domains' filter is enabled by specifying:

Apache:
ModPagespeedEnableFilters rewrite_domains
Nginx:
pagespeed EnableFilters rewrite_domains;

in the configuration file. The filter is not enabled by default and should be added manually to the configuration file.

By default rewrite_domains only applies to resources, but it can optionally rewrite domains in hyperlinks as well:

Apache:
ModPagespeedDomainRewriteHyperlinks on
Nginx:
pagespeed DomainRewriteHyperlinks on;

Description

This filter applies all domain mapping directives specified in pagespeed.conf to web resources that are not otherwise rewritten by PageSpeed. For example, if a resource is not cacheable, or filters which affect the resource are turned off, then it still may be desirable to apply domain sharding. (Domain sharding is not applied to hyperlinks even if DomainRewriteHyperlinks is enabled.)

Requirements

It is the responsibility of the site administrator to set up the shard entries in their DNS or CNAME configuration. Also, please see the note about the servers for rewrite domains — this applies to sharded domains as well. The sharded domains must have access to the same content as the original domain.

Risks

It is the responsbility of the site administrator to ensure that moving resources onto domains does not create a security vulnerability. In particular, if the target domain has cookies, then any JavaScript loaded from a resource moved to a domain with cookies will gain access to those cookies. In general, moving resources to a cookieless domain is a great way to improve security. Be aware that CSS can load JavaScript in certain environments.