0

We're running Nginx 1.6.2 and setup as a load balancer (using proxy) along with our backend servers. Noticed the other day, when I make updates on backend servers the changes are NOT visible to web front-end. It continues to show old version.

Things we've done:

  1. We've tested all browsers and same results occur.
  2. Upgraded to Nginx 1.9.4 - still does not fix issue
  3. I even set Cache-Control to no-cache to try ruling out cache as a problem. I did notice in Developer Tools, if I check the relevant files - date modified is showing an old date, it doesn't show when they were actually updated.
  4. Cleared out files located at /var/lib/nginx/tmp/proxy/

Additionally, the specific files we're talking about are .css and .js files

Lastly, if we directly connect into one of the web backends, it works perfectly!!! (this is why we think it's related to Nginx).

Any advice or recommendations for this would be greatly appreciated.

Responses header for js file:

Response headers:
Connection:keep-alive
Content-Length:33365
Content-Type:application/javascript
Date:Fri, 25 Sep 2015 13:07:58 GMT
Last-Modified:Sat, 08 Aug 2015 17:56:52 GMT
Server:nginx/1.9.4
Strict-Transport-Security:max-age=31536000

Request headers
Accept:*/*
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:__utmt=1; JSESSIONID=18CB152C40CC7C3A9C8C2058BC9ABA1C;      __utma=129083286.1723352187.1441183278.1443165488.1443186453.22; __utmb=129083286.2.10.1443186453; __utmc=129083286; __utmz=129083286.1442402128.17.2.utmcsr=console.aws.amazon.com|utmccn=(referral)|utmcmd=referral|utmcct=/support/chat
Host:ourdomain.com
Pragma:no-cache
Referer:https://ourdomain.com/dashboard/adminDashboard
User-Agent:Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.122 Mobile Safari/537.36

Response header for .css file

Connection:keep-alive
Content-Length:31125
Content-Type:text/css
Date:Fri, 25 Sep 2015 13:07:57 GMT
Last-Modified:Thu, 27 Aug 2015 08:44:24 GMT
Server:nginx/1.9.4
Strict-Transport-Security:max-age=31536000

Nginx conf

user nginx;
worker_processes 22;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
    # Basic Settings
        ##

    sendfile off;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        client_max_body_size 15M;
        # server_tokens off;

 proxy_headers_hash_max_size 51200;
        proxy_headers_hash_bucket_size 6400;
#         server_names_hash_bucket_size 6400;
        # server_name_in_redirect off;

#        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
    # Logging Settings
        ##

    access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
    # Gzip Settings
        ##

    gzip on;
        gzip_disable "msie6";
        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
    # nginx-naxsi config
        ##
    # Uncomment it if you installed nginx-naxsi
        ##
        #include /etc/nginx/naxsi_core.rules;

        ##
    # nginx-passenger config
        ##
    # Uncomment it if you installed nginx-passenger
        ##

    #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

        ##
    # Virtual Host Configs
        ##

    include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
       # include /etc/nginx/sites-available/*;

#upstream backend {
#    server 128.199.57.230;
#    server 104.236.50.191;
#    server 10.0.0.3:80;
#}
#server {
#        listen 80;
#location / {
#            proxy_pass http://backend;
#        }
4
  • What response code are you getting from the .css/.js? I'm assuming it's a 304 given the Last-Modified date back in August? Sep 25, 2015 at 13:31
  • The status code under Headers shows 200 OK for both files :-/
    – Aaron
    Sep 25, 2015 at 13:35
  • Ok, that at least tells us it's the proxy server sending the response. Can you post your nginx.conf from the proxy server? Sep 25, 2015 at 13:42
  • Alright, @LukePeterson I've posted the nginx.conf file, let me know if there are any other files I should provide as well.
    – Aaron
    Sep 25, 2015 at 19:20

0

You must log in to answer this question.

Browse other questions tagged .