Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Timeout when using proxy_pass #1012

Closed
zarza opened this issue Sep 24, 2015 · 5 comments
Closed

Timeout when using proxy_pass #1012

zarza opened this issue Sep 24, 2015 · 5 comments

Comments

@zarza
Copy link

zarza commented Sep 24, 2015

We're getting this in our logs:
[ngx_pagespeed 1.9.32.6-7321] Serf status 20014(Internal error) polling for 1 threaded fetches for 0.05 seconds
2015/09/24 16:10:00 [error] 19762#0: [ngx_pagespeed 1.9.32.6-7321] URL https://... (connecting to:127.0.0.1:7779) active for 1 ms

How can we increase those 0.05 seconds?

We already tried by our own but looks like we're missing something.

Thank you for your time.

@jeffkaufman
Copy link
Contributor

Could you try adding:

pagespeed ListOutstandingUrlsOnError on; 

to your config to help debug this?

(It's not complaining about a 0.05 timeout; something else went wrong.)

Could you also paste the pagespeed directives you have in your config? I'm especially interested in any MapOriginDomain or MapRewriteDomain lines.

This earlier thread looks relevant: https://groups.google.com/forum/#!topic/ngx-pagespeed-discuss/EAgku-2C-o8

@zarza
Copy link
Author

zarza commented Sep 30, 2015

Hi jeffkaufman, thank you for your time and for your great work.

ListOutstandingUrlsOnError is already on.

Currently we're not using MapOriginDomain or MapRewriteDomain, should we?

@zarza
Copy link
Author

zarza commented Sep 30, 2015

 server {

        listen 0.0.0.0:7779;
        server_name xxxx.com;
        server_name www.xxxx.com;
        access_log "/var/log/nginx/xxxx.com_access_ssl_ps_log";
        error_log "/var/log/nginx/xxxx.com_error_ssl_ps_log";
        ssl off;

        pagespeed on;
        pagespeed FileCachePath /var/ngx_pagespeed_sites/xxxx.com;


        location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
        add_header "" "";
        keepalive_timeout 0;
        }

        location ~ "^/pagespeed_static/" { }
        location ~ "^/ngx_pagespeed_beacon$" { }

        location ~ /\.ht {
            deny  all;
        }
        location / {
            proxy_pass https://xxxx:443;
            proxy_read_timeout 60s;
            proxy_set_header Host               $host;
            proxy_set_header X-Real-IP         $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            access_log off;


        }

    }

@oschaaf
Copy link
Member

oschaaf commented Oct 1, 2015

It looks to me like pagespeed is trying to fetch using https via 127.0.0.1:7779:

2015/09/24 16:10:00 [error] 19762#0: [ngx_pagespeed 1.9.32.6-7321] URL https://... (connecting to:127.0.0.1:7779) active for 1 ms

while the server configuration you just posted doesn't have https enabled:

     ssl off;

Is there are server in front of ngx_pagespeed that terminates SSL?

@zarza
Copy link
Author

zarza commented Oct 22, 2015

Thank you for your update Oschaaf. After some changes we got it working. Thank you again!

@zarza zarza closed this as completed Oct 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants