pagespeed MapRewriteDomain giving 404's on image rewrites

38 views
Skip to first unread message

jerod moore

unread,
Jul 14, 2016, 12:39:59 AM7/14/16
to ngx-pagespeed-discuss
Im not sure if this is a bug or a config issue. Seems like it would be a common use case.
 
## PageSpeed configurations
pagespeed
FetchHttps enable,allow_self_signed;
pagespeed
MaxCacheableContentLength -1;


## Resource filters
include apps
/pagespeed/resource_filters.conf;


## Miscellaneous
pagespeed
EnableFilters add_instrumentation;
pagespeed
EnableFilters insert_dns_prefetch;
pagespeed
EnableFilters prioritize_critical_css;
pagespeed
EnableFilters collapse_whitespace;
## Cache
pagespeed
EnableFilters extend_cache;
pagespeed
EnableFilters extend_cache_pdfs;
pagespeed
EnableFilters local_storage_cache;


pagespeed
EnableFilters rewrite_images;
pagespeed
MapRewriteDomain https://mydomain.com/img http://ep.yimg.com;
## Ensure requests for pagespeed optimized resources go to the pagespeed handler
## and no extraneous headers get set.
location
~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
  add_header
"" "";
}
location
~ "^/pagespeed_static/" { }
location
~ "^/ngx_pagespeed_beacon$ps_dollar" { }


## PageSpeed Admin paths
include apps
/pagespeed/admin_ui.conf;
~


Otto van der Schaaf

unread,
Jul 14, 2016, 4:40:39 AM7/14/16
to ngx-pagespeed-discuss

Could you add the following to your configuration?:


pagespeed MapOriginDomain http://ep.yimg.com https://mydomain.com/img ep.yimg.com;


That should set ngx_pagespeed up for correctly routing back any incoming requests resulting from the domain rewriting you have configured. 


Otto


Reply all
Reply to author
Forward
0 new messages