Coder Social home page Coder Social logo

Comments (4)

wolfie82 avatar wolfie82 commented on May 29, 2024 1

ok I figured it out. I needed to set

map $scheme $https_suffix { default '-https'; https '-https'; } in the common.conf

Thanks!

from wordpress-nginx.

pothi avatar pothi commented on May 29, 2024

Hi,

Thanks for creating a new issue.

Please forgive my ignorance. I could not understand what you are trying to say.

for example in example.com.conf, if you include any of the caching plugins you'll always see the header X-CACHE MISS.

No. I use example.com.conf too with WP Super Cache as the caching plugin on my site https://www.tinywp.in . You would see "x-cache" "miss" header in it only when the cache is not filled. Once filled (after the first visit), you wouldn't see "x-cache" "miss". Instead, you'd see "x-cache" "hit".

Do you have a test site where I can see a different behavior to understand what you are trying to say?

from wordpress-nginx.

wolfie82 avatar wolfie82 commented on May 29, 2024

I'm actually using WP Rocket.

Heres my observation.

I always see the MISS header, but none of the other headers in location /. However, I know we're serving the cached instance because I can see the page source with the annotation. Further I know the location / is being executed because I can do a return 404 and see the 404. For whatever reason the headers are getting lost.

<!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me - Debug: cached@1540280391 -->

from wordpress-nginx.

wolfie82 avatar wolfie82 commented on May 29, 2024

Heres another example. I would never see the header foo bar here. I think this is because, per the documentation, location definitions in nginx inherit headers of the parent, however, if you specify headers in a location header that executes it overwrites the parent.

` location ~* .php$ {
fastcgi_split_path_info ^(.+.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) { return 404; }

    # Mitigate https://httpoxy.org/ vulnerabilities
    fastcgi_param HTTP_PROXY "";

    include "fastcgi_params";
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_index               index.php;
    fastcgi_pass                fpm;

    add_header "X-CACHE" "MISS";
}
include "globals/wp-rocket.conf";
add_header foo bar;

`

from wordpress-nginx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.