<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Alex/all,</p>
    <p>How did you fix?</p>
    <p>I've got a very similar issue.</p>
    <p>nginx running Wordpress with the Hypercache plugin but only the
      homepage is cached, other pages "miss" according to page headers.</p>
    <p>Thanks,<br>
      Jore<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 24/5/20 7:04 am, Alex Evonosky
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFZdCurA8Yy3bwUK09FMex1wEQjvu6e9zGHFgO6b9-7KunAZ1A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Disregard, found the issue.
        <div><br>
        </div>
        <div>thank you.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Sat, May 23, 2020 at 4:18
          PM Alex Evonosky <<a href="mailto:alex.evonosky@gmail.com"
            moz-do-not-send="true">alex.evonosky@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">"Can you be more specific? Which "cache"?
            Browser cache? Nginx content<br>
            cache? try_files has nothing to do with caching..."<br>
            <br>
            <br>
            Nginx content cache<br>
            <br>
            <br>
            "Either way, you need to check your headers to ensure that
            they allow<br>
            caching for said pages. Also if any cookies are being sent
            then nginx<br>
            won't cache the page."<br>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>I looked at the headers using CURL..  </div>
            <div><br>
            </div>
            <div>The issue seems this:</div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>The request hits NGINX and the backend server(s) for
              Wordpress are cached just fine from just the FQDN --- <a
                href="http://example.com" target="_blank"
                moz-do-not-send="true">example.com</a></div>
            <div><br>
            </div>
            <div>however, if I try to go to say, <a
                href="http://example.com/?page_id=1234" target="_blank"
                moz-do-not-send="true">example.com/?page_id=1234</a>,
              the headers do not show NGINX anymore, as only the servers
              for Wordpress show up; Almost like a </div>
            <div>cache punch-hole.</div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>===== proxy.conf ====</div>
            <div><br>
            </div>
            <div>proxy_cache_path /tmp/cache keys_zone=my_cache:10m
              max_size=10m inactive=60m;<br>
              <br>
              #proxy_redirect off;<br>
              proxy_set_header Host $host;<br>
              proxy_set_header X-Real-IP $remote_addr;<br>
              proxy_set_header X-Forwarded-For
              $proxy_add_x_forwarded_for;<br>
              add_header X-Cache-Status $upstream_cache_status;<br>
              client_max_body_size 10m; <br>
              client_body_buffer_size 128k;<br>
              proxy_connect_timeout 90;<br>
              proxy_send_timeout 90;<br>
              proxy_read_timeout 90;<br>
              proxy_buffers 32 4k;<br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>==== nginx.conf ====</div>
            <div><br>
            </div>
            <div>http {<br>
                      upstream <a href="http://example.com"
                target="_blank" moz-do-not-send="true">example.com</a> {<br>
                      least_conn;<br>
                      server <a href="http://10.10.10.138:8999"
                target="_blank" moz-do-not-send="true">10.10.10.138:8999</a>;<br>
                      server <a href="http://10.10.10.84:8999"
                target="_blank" moz-do-not-send="true">10.10.10.84:8999</a>;<br>
                      }<br>
              <br>
            </div>
            <div>server {<br>
              listen 82;<br>
              location / {<br>
              try_files $uri $uri/ /$args /index.php?$args;<br>
              proxy_cache my_cache;<br>
              proxy_cache_use_stale error timeout http_500 http_502
              http_503 http_504;<br>
              proxy_cache_background_update on;<br>
              proxy_pass <a href="http://example.com" target="_blank"
                moz-do-not-send="true">http://example.com</a>;<br>
              proxy_cache_valid any 60m;<br>
              proxy_cache_methods GET HEAD POST;<br>
              proxy_http_version 1.1;<br>
              proxy_set_header Connection keep-alive;<br>
              proxy_ignore_headers Cache-Control Expires Set-Cookie;<br>
                    }</div>
            <div>}<br>
              <br>
              sendfile on;<br>
              tcp_nopush on;<br>
              tcp_nodelay on;<br>
              keepalive_timeout 65;<br>
              types_hash_max_size 2048;<br>
              <br>
              gzip on;<br>
              gzip_disable "msie6";<br>
              <br>
              # include /etc/nginx/conf.d/*.conf;<br>
              # include /etc/nginx/sites-enabled/*;<br>
              include /etc/nginx/proxy.conf;<br>
              <br>
              }<br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>Thank you,</div>
            <div>Alex</div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Sat, May 23, 2020 at
              8:43 AM J.R. <<a href="mailto:themadbeaker@gmail.com"
                target="_blank" moz-do-not-send="true">themadbeaker@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">> And the main page
              caches OK, but any page the resides on the "?page_id" is<br>
              > not getting cached.  Is there more to the "try_files"
              that needs applied<br>
              > for caching of these permalinks?<br>
              <br>
              Can you be more specific? Which "cache"? Browser cache?
              Nginx content<br>
              cache? try_files has nothing to do with caching...<br>
              <br>
              Either way, you need to check your headers to ensure that
              they allow<br>
              caching for said pages. Also if any cookies are being sent
              then nginx<br>
              won't cache the page.<br>
              _______________________________________________<br>
              nginx mailing list<br>
              <a href="mailto:nginx@nginx.org" target="_blank"
                moz-do-not-send="true">nginx@nginx.org</a><br>
              <a href="http://mailman.nginx.org/mailman/listinfo/nginx"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
    </blockquote>
  </body>
</html>