I set up nginx to serve a rails application for our intranet. It runs on a osx server blade with snow leopard. When I work on the server and go to localhost:8444 it runs very smooth and fast, but when I connect to the server over the network on a different client, it takes around 30-50 seconds to load one page (and then it is even displayed not correctly as there are missing javascript files).
my nginx.conf looks like this:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
passenger_root /Users/myuser/.rvm/gems/ruby-1.9.2-p180@rails311/gems/passenger-3.0.9;
passenger_ruby /Users/myuser/.rvm/wrappers/ruby-1.9.2-p180@rails311/ruby;
server {
listen 8080;
#server_name my_intranet;
root /Users/myuser/rails/myapp/public;
passenger_enabled on;
rails_env development;
}
}
I tried using more worker_processes but that didn't change anything. Before the application was running on WEBrick on port 3000, now on nginx port 8444. I declared a NAT rule on our router that forwards requests from port external port 3000 to internal port 8444 (so the link to the app does not change for end users).
Any ideas what could be the reason (I am using the same nginx.conf on my notebook and it performs good over network...)