Welcome! Log In Create A New Profile

Advanced

Website hit returning CSS code instead of html, is this due to some caching mess up?

Jane Jojo
May 19, 2018 10:12PM
Hi all,



This problem is intermittent and only some of my viewers experience this.
For reference here’s the screencast of hitting the url via curl:
https://d.pr/v/lRE2w2 and another one from a user: https://d.pr/i/uTWsst .
My website is https://www.alittlebitofspice.com/



Recently I setup reverse proxy caching and here’s the relevant code



location / {

proxy_pass http://127.0.0.1:8000;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto https;

proxy_set_header X-Forwarded-Port 443;





# If logged in, don't cache.

if ($http_cookie ~*
"comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {

set $do_not_cache 1;

}

proxy_cache_key "$scheme://$host$uri";

proxy_cache staticfilecache;

proxy_cache_valid 200 302 100d;



add_header Cache-Control public;

#proxy_hide_header "Set-Cookie";

#proxy_ignore_headers "Set-Cookie";



proxy_ignore_headers Expires;

proxy_ignore_headers "Cache-Control";

proxy_ignore_headers X-Accel-Expires;



proxy_hide_header "Cache-Control";

proxy_hide_header Pragma;

proxy_hide_header Server;

proxy_hide_header Request-Context;

proxy_hide_header X-Powered-By;



proxy_set_header Accept-Encoding "";



proxy_cache_use_stale error timeout invalid_header
updating http_500 http_502 http_503 http_504;

proxy_cache_bypass $arg_nocache $do_not_cache;



}



Am I doing something wrong here? Can someone please help me understand why
this is happening?



Help much appreciated.



- Jane
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Website hit returning CSS code instead of html, is this due to some caching mess up?

Jane Jojo May 19, 2018 10:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 157
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready