You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2020/11/23 20:10:07 UTC

[GitHub] [incubator-pagespeed-mod] luison opened a new issue #2052: Trying to understand pagespeed Domain

luison opened a new issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052


   Hi. been using pagespeed for a while and trying to do some optimization now but just can't figure out completely how to authorize it to apply to some of our other domains.
   
   Our setup is one with a Nginx reverse proxy server (nginx version: nginx/1.18.0) with pagespeed (V 14) installed handling SSL and proxying via upstream to apache servers via http on different containers.
   
   We have pagespeed activated per domain basis with a specific:
   
   pagespeed on;  - per server domain
   
   So mainproject.com pagespeed is working but we alss load some resources from two additional servers on our html like so:
   
   Both domains are also in the same reverse proxy server:
   
   https://assets.domain.com ---> internal IP port 80 via upstream - pagespeed not active on this nginx server
   https://image.domain.com ---> internal IP port 80 via upstream - pagespeed not active on this nginx server
   
   At our maindomain.com project pagespeed config includes:
   
   pagespeed Domain assets.domain.com;
   pagespeed Domain https://image.domain.com;
   
   We've also tried including or not https protocol and MapOriginDomain rules but we always get:
   `[Mon, 23 Nov 2020 19:53:16 GMT] [Info] [8695] No permission to rewrite https://image.domain.com/t/230x260/smart/gis/recursos/timeline_1995.jpg'
   `
   Are we misunderstanding how we should activate pagespeed as we understood that the Domain directive should allow pagespeed to rewrite those too?
   Should they also be active with their own config on each of those internal CDN domains?
   
   Pagespeed admin info page shows:
   Domain Lawyer
     http:// assets.domain.com/ Auth
     https://image.domain.com/ Auth
   
   
   Thanks.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-pagespeed-mod] luison edited a comment on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
luison edited a comment on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-732813314


   Hi @Lofesa. That clarifies a bit but it does not reflect our setup-
   
   We have nginx proxy+pagespeed --> apache servers  (no pagespeed there). 
   
   Except for some static path (css, img) that are server locally by the proxy (bind mount of assets) the rest is all requested to the upstreams.  For the main domain pagespeed seems to be working with css and some images. For example we have a php minifier for the css (apache upstream) and we can see that pagespeed is doing its "thing" there.
   
   Our issue is that images and some other static content comes from other of our domains that work the same way but will never serve html) so the rewrite would need to be done at the maindomain and not on the imagedomain. 
   
   I've tried your option of an image rewrite via subdir but I still get the "No permission to rewrite" for the image domain on the logs.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Re: [GitHub] [incubator-pagespeed-mod] luison commented on issue #2052: Trying to understand pagespeed Domain

Posted by Longinos Ferrando <lo...@gmail.com>.
I'm out of house for some hours,  with mobile device. When returns to house
I will see the whole message.
The thing is, mainproject processes html code, and the others URLs
contained in the html code processed by the mailproject. Right?
Then you need pagespeed enabled in these other server blocks.
And in the mainproject you need some like:
pagespeed Domain http*://*.domain.com;
This cover all version (http/Https) and all subdomains ( Are images and
assets subdomains from the same domain that mainproject?)

In all other servers blocks yo need
pagespeed on;
pagespeed Domain http*://images.domain.com;
Same for assets.
Most of the pagespeed directives that are common to al servers, you can put
it in the nginx http block, and not need to duplicate it.

In other hand, pagespeed off; can't disable pagespeed, or not totally. IPRO
still working. To disable totally, you must use pagespeed unplugged;

El mar., 24 nov. 2020 15:15, GitBox <gi...@apache.org> escribió:

>
> luison commented on issue #2052:
> URL:
> https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-733000614
>
>
>    Hi again, thanks for the prompt reply.
>    No, our setup is more like
>
>    ```
>    nginx {
>       all server stuff
>       pagespeed config stuff
>       pagespeed off
>    }
>
>    server {
>           port 443;
>          name mainproject.domain.com;
>          pagespeed on; (and all pagespeed config needed)
>           location /static - serving directly css, img, js
>          all nginx proxy stuff;
>    }
>    server {
>           port 443;
>          name images.domain.com;
>           pagespeed off;
>           all nginx proxy stuff; (included proxy_pass
> http://images.domain.com;)
>    }
>    server {
>           port 443;
>          name assets.domain.com;
>          pagespeed off;
>          all nginx proxy stuff; (included proxy_pass
> http://assets.domain.com;)
>    }
>    ```
>
>    mainproject is proxying our backend for all php mainly
>    images coming from images.domain.com
>
>    I guess by your message that my answer then is that if I wan pagespeed
> on maindomain to interact with resources coming from images.domain.com I
> need pagespeed on also on that nginx server proxy with its own config set
> (only images resizing in that case) correct?
>
>
>
>
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>
>

[GitHub] [incubator-pagespeed-mod] luison commented on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
luison commented on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-733000614


   Hi again, thanks for the prompt reply.
   No, our setup is more like
   
   ```
   nginx {
      all server stuff
      pagespeed config stuff
      pagespeed off
   }
   
   server {
          port 443;
         name mainproject.domain.com;
         pagespeed on; (and all pagespeed config needed)
          location /static - serving directly css, img, js      
         all nginx proxy stuff; 
   }
   server {
          port 443;
         name images.domain.com;
          pagespeed off;
          all nginx proxy stuff; (included proxy_pass http://images.domain.com;)
   }
   server {
          port 443;
         name assets.domain.com;
         pagespeed off; 
         all nginx proxy stuff; (included proxy_pass http://assets.domain.com;)
   }
   ```
   
   mainproject is proxying our backend for all php mainly
   images coming from images.domain.com 
   
   I guess by your message that my answer then is that if I wan pagespeed on maindomain to interact with resources coming from images.domain.com I need pagespeed on also on that nginx server proxy with its own config set (only images resizing in that case) correct?
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-pagespeed-mod] Lofesa commented on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-732443674


   Hi great Luis  =;-))
   Well... you have a nginx proxy+pagespeed --> apache servers (main+pagespeed, image and assets), rigth?
   Then Apache(main+pagespeed) get html pages that contains urls from image and assets, rigth?
   I think that in (nginx proxy+pagespeed) pagespeed is not needed . And you must configure Apache servers+pagespeed in each and a [downstream cache](https://www.modpagespeed.com/doc/downstream-caching).
   
   How Domain works:
   You have a SiteA and a SiteB. The site A generates html code that contains url from SiteB.
   In SiteA you have:
   `pagespeed Domain http*://siteA` (with this notation you cover the http and the https version)
   `pagespeed Domain http:*//siteB
   `
   Whit this config, pagespeed in SiteA can rewite (aka optimize) urls from SiteB, but can´t test if the rewrited url exits in SiteB, so if  SiteB don´t run pagespeed module, when a request like https://siteB/some-image.jpg.ci.pagespeed.some-hash.web comes, it returns a 404 because don´t know nothing about pagespeed rewrited url.
   So, when you use pagespeed Domain is only for domains you know are running pagespeed module.
   
   But you can try some like this:
   
   pagespeed Domain http*://myproyect.domain.com
   pagespeed MapProxyDomain https://myproyect.domain.com/images http://images.domain.com
   pagespeed MapProxyDomain https://myproyect.domain.com/assets http://assets.domain.com
   
   In this way all the content from http://images.domain.com are served under the url https://myproyect.domain.com/images.
   https://myproyect.domain.com/images this need to be a file folder to store files.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-pagespeed-mod] Lofesa commented on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-732836295


   So you have some like this in your nginx proxy **cache** + pagespeed:
   
   ```
   server {
          port 443;
         name mainproject.domain.com;
         pagespeed on; (and all pagespeed config needed)
         all nginx proxy stuff; 
   }
   server {
          port 443;
         name images.domain.com;
         pagespeed on; (and all pagespeed config needed)
         all nginx proxy stuff; (included proxy_pass http://images.domain.com;)
   }
   server {
          port 443;
         name assets.domain.com;
         pagespeed on; (and all pagespeed config needed)
         all nginx proxy stuff; (included proxy_pass http://assets.domain.com;)
   }
   
   ```
   and then pagespeed do it stuff with proxied content?
   or maybe:
   ```
   server {
          port 443;
         name mainproject.domain.com;
         pagespeed on; (and all pagespeed config needed)
         all nginx proxy stuff; 
         location /images/ {
               proxy_pass http://images.domain.com;
         }
         location /assets/ {
             proxy_pass http://assets.domain.com;
         }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-pagespeed-mod] luison commented on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
luison commented on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-732813314


   Hi @Lofesa. That clarifies a bit but it does not reflect our setup-
   
   We have nginx proxy+pagespeed --> apache servers  (no pagespeed there). 
   
   Except for some static path (css, img) that are server locally by the proxy (bind mount of assets) the rest is all requested to the upstreams.  For the main domain pagespeed seems to be working with css and some images. For example we have a php minifier for the css (apache upstream) and we can see that pagespeed is doing its "thing" there.
   
   Our issue is that images and some other static content comes from other of our domains that work the same way but will never serve html) so the rewrite would need to be done at the maindomain and not on the imagedomain. 
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-pagespeed-mod] Lofesa commented on issue #2052: Trying to understand pagespeed Domain

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #2052:
URL: https://github.com/apache/incubator-pagespeed-mod/issues/2052#issuecomment-733140253


   I'm out of house for some hours,  with mobile device. When returns to house I will see the whole message.
   The thing is, mainproject processes html code, and the others URLs contained in the html code processed by the mailproject. Right?
   Then you need pagespeed enabled in these other server blocks.
   And in the mainproject you need some like:
   pagespeed Domain http*://*.domain.com;
   This cover all version (http/Https) and all subdomains ( Are images and assets subdomains from the same domain that mainproject?)
   
   In all other servers blocks yo need
   pagespeed on;
   pagespeed Domain http*://images.domain.com;
   Same for assets.
   Most of the pagespeed directives that are common to al servers, you can put it in the nginx http block, and not need to duplicate it.
   
   In other hand, pagespeed off; can't disable pagespeed, or not totally. IPRO still working. To disable totally, you must use pagespeed unplugged;
   
   P.S: I have send ths by email, but don´t see it here


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org