Lofesa commented on issue #1897:
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/1897#issuecomment-963459358


   This config is a lot confusing for me.
   You have a server block for each IP/port, and is supossed that ipv4:443 must 
have the exact same config that ipv6:443, both are serving the same content 
whit the same config, no?
   Why you no do this:
   ```
   server {
             name bla.bla.com;
             name www.bla.bla.com;
             listen ipv4:443
             listen ipv6:443
   }
   ```
   Whit the config you have, I think all request that go to the :80 port are 
served by the ipv4:443 because is the 1st server blok that matches :443 and the 
same name
   
   But the relevan pat for the issue is here:
   
   ```
   location @fallback {
                   proxy_pass https://[2a01:4f9:3a:1041::2]:7081;
                   proxy_hide_header upgrade;
                   proxy_set_header Host             $host;
                   proxy_set_header X-Real-IP        $remote_addr;
                   proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                   access_log off;
   
           }
   
           location 
~^/(.*\.ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip|webp))$
 {
                   try_files $uri @fallback;
           }
   ```
   If the file is not found then go to the apache.
   Can you see if in the apache logs are request for url with pagespeed in it?
   Apache donĀ“t run pagespeed, rigth? so when a url with pagespeed in it 
arrives then return a 404.
   
   I I understand you, the pagespeed directives are included in.
   `include 
"/var/www/vhosts/system/subdomain.example.com/conf/vhost_nginx.conf";
   
   put this line at the top of the server block or allmost before the location 
for statics files. Why?
   Because uri URI like
   
`/pub/media/catalog/product/cache/9cb80aaa700fbabda1d30deb1d8f7ff5/w/r/xwrt106300_a.jpg.pagespeed.ic.SOMEHASH.webp`
   is captured by the location, so never reaches the locations you have in the 
vhos_nginx.conf, this one
   ```
   location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
        add_header "" "";
   }
   ```
   `Is how nginx works, parse the config file up to down, and when some matches 
stop the search.


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@pagespeed.apache.org

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


Reply via email to