# If you are using thin with sockets upstream castronaut { server unix:/tmp/castronaut.0.sock; } # Uncomment if you are not using sockets # upstream castronaut { # server 127.0.0.1:4567; # } server { listen 80; server_name myapp.com; location / { proxy_pass http://castronaut; proxy_redirect off; proxy_set_header Host $host; } root /path/to/castronaut/; access_log /var/log/nginx/castronaut/access.log; error_log /var/log/nginx/castronaut/error.log; }