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

Jane Jojo janejojo at gmail.com
Sun May 20 02:03:34 UTC 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180519/ccf97aba/attachment.html>


More information about the nginx mailing list