remfull
2007-Jun-25 13:03 UTC
problem with nginx in combination with ujs plugin and firefo
Hi, I have a nginx frontend server with a mongrel backend. it all worked fine. Then i used the ujs plugin and changed the following line in the nginx.conf i changed this section: location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ { client_max_body_size 20M; root /var/rails_apps/hozl/public; } i removed the ''js'' extension because otherwise nginx tries to serve all the javascript which now is partly generated by mongrel because of the ujs plugin after this change all worked fine .... on IE the problems begin with firefox. (mostly it is the other way around, i know :)) sometimes i can load a page quickly but very often all seems to freeze. firefox says "waiting for <mywebsite> " and after a while i get a page looking like html source code like this: HTTP/1.1 302 Moved TemporarilyServer: nginx/0.5.11 Date: Mon, 25 Jun 2007 12:43:28 GMT Content-Type: text/html Connection: keep-alive Set-Cookie: _session_id=1f42a7cd18af6b0bf56afb3f9de57adf; path=/ Status: 302 Found Cache-Control: no-cache location: http://demo5.xwire.nl/patients/search Content-Length: 103 <html><body>You are being <a href="http://demo5.xwire.nl/patients/search">redirected</a>.</body></html> my nginx.conf file looks like this: # number of nginx workers worker_processes 6; error_log logs/error.log notice; pid logs/nginx.pid; # Number of worker connections. 1024 is a good default events { worker_connections 1024; } http { include conf/mime.types; default_type application/octet-stream; # no sendfile on OSX uncomment # this if your on linux or bsd sendfile on; tcp_nopush on; tcp_nodelay off; #keepalive_timeout 165; upstream hozl2 { server 127.0.0.1:8030; server 127.0.0.1:8031; server 127.0.0.1:8032; } server { listen 80; client_max_body_size 50M; server_name hozl2; root /var/rails_apps/hozl2/public; access_log off; rewrite_log on; # / -> first search for local index.html then go to mongrel location ~ ^/$ { client_max_body_size 20M; if (-f /index.html){ rewrite (.*) /index.html last; } proxy_pass http://hozl2; } # rail caching: searching first for $action.html local pages location / { client_max_body_size 20M; if (!-f $request_filename.html) { proxy_pass http://hozl2; } rewrite (.*) $1.html last; } # serve static files directly location ~ .html { client_max_body_size 50M; root /var/rails_apps/hozl2/public; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mov)$ { client_max_body_size 50M; root /var/rails_apps/hozl2/public; } # resend everything else to mongrel location / { client_max_body_size 50M; proxy_pass http://hozl2; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } } i hope somebody knows where to look, cause i am lost here thanks Remco -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---