nginx: js file loads indifferently every refresh

Posted by poymode on Server Fault See other posts from Server Fault or by poymode
Published on 2010-06-16T04:32:45Z Indexed on 2010/06/16 4:43 UTC
Read the original article Hit count: 232

Filed under:
|
|

I have this nginx problem wherein a js file in a rails app loads indifferently. Whenever I try to access the JS file in the browser and refresh the page, the scrollbar changes length meaning sometimes it loads half the js page, sometimes the whole and sometimes just a part of it.

the js file size is 71K. my nginx server is on different server,separate from my rails app. when I try to access the js file directly through the app server, lets say 10.48.30.150:3000/javascripts/file.js it works fine and doesnt show any half-loaded page.

but when I use the nginx server which upstreams the rails app, it shows the indifferent page loads.

here is my nginx http conf


error_log /usr/local/nginx/logs/error.log;
pid /usr/local/nginx/logs/nginx.pid;

events {
  worker_connections 1024;
}

http {

  include mime.types;
  default_type application/octet-stream;
  server_names_hash_bucket_size 256;
  access_log /usr/local/nginx/logs/access.log;
  sendfile on;
  #tcp_nopush on;
  keepalive_timeout 0;
  tcp_nodelay on;
  #gzip on;
  #gzip_min_length 4096;
  #gzip_buffers 16 8k;
  #gzip_types application/x-javascript text/css text/plain;
  large_client_header_buffers 4 8k;
  client_max_body_size 2G;
  include /usr/local/nginx/conf.d/*.conf;
}

© Server Fault or respective owner

Related posts about nginx

Related posts about rails