anchor.diff:        }
   
         location / {
  -        <% if is_using('passenger',:app_server) %>
  +      <% if nginx_simple_auth %>
  +        auth_basic "<%= nginx_simple_auth_message %>";
  +        auth_basic_user_file <%= File.join("#{shared_path}", "config", ".htpasswd") %>;
  +      <% end %>
  +      <% if is_using('passenger',:app_server) %>
           rails_env <%= rails_env %>;
           passenger_enabled on;
  -        <% end %>
  +      <% end %>
   
           # needed to forward user's IP address to rails
           proxy_set_header  X-Real-IP  $remote_addr;
  
positive.code: 
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
  
            # If the file exists as a static file serve it directly without
            # running all the other rewite tests on it
  
negative.code:         proxy_redirect off;
          proxy_max_temp_file_size 0;
  
  
          # if the request is for a static resource, nginx should serve it directly
          # and add a far future expires header to it, making the browser
          # cache the resource and navigate faster over the website.
          location ~ ^/(assets)/.+-([0-9a-zA-Z])+\. {
            gzip_static on;
            expires max;
            add_header Cache-Control public;
          }        
  
          # Serve images outside the asset path
          # Now this supposedly should work as it gets the filenames with querystrings that Rails provides.
          # BUT there's a chance it could break the ajax calls.
          location ~* \.(ico|css|gif|jpe?g|png)(\?[0-9]+)?$ {
             expires max;
          }
  
          # Serve javascript outside the asset path
          location ~ ^/javascripts/.*\.js(\?[0-9]+)?$ {
             expires max;
          }
  
          # If the file exists as a static file serve it directly without
          # running all the other rewite tests on it
  