최신 버전의 사이트를 표시하는 이상한 Nginx 문제

최신 버전의 사이트를 표시하는 이상한 Nginx 문제

우리는 Nginx 1.6.2를 실행하고 있으며 백엔드 서버와 함께 로드 밸런서(프록시 사용)로 설정하고 있습니다. 일전에 백엔드 서버를 업데이트할 때 변경 사항이 웹 프런트엔드에 표시되지 않는다는 사실을 발견했습니다. 계속해서 이전 버전이 표시됩니다.

우리가 한 일들:

  1. 우리는 테스트했습니다모두브라우저와 동일한 결과가 발생합니다.
  2. Nginx 1.9.4로 업그레이드 - 여전히 문제가 해결되지 않음
  3. 캐시를 문제로 배제하기 위해 Cache-Control을 no-cache로 설정하기도 했습니다. 개발자 도구에서 관련 파일을 확인하면 수정된 날짜가 이전 날짜로 표시되고 실제로 업데이트된 날짜는 표시되지 않습니다.
  4. /var/lib/nginx/tmp/proxy/에 있는 파일을 지웠습니다.

또한 우리가 말하는 특정 파일은 다음과 같습니다..css그리고.js파일

마지막으로,웹 백엔드 중 하나에 직접 연결하면 완벽하게 작동합니다!!!(이것이 우리가 Nginx와 관련이 있다고 생각하는 이유입니다.).

이에 대한 조언이나 권장 사항을 주시면 감사하겠습니다.

js 파일의 응답 헤더:

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

.css 파일의 응답 헤더

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 설정

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;
#        }

관련 정보