upstream thin_cluster { server unix:/tmp/thin.0.sock; # server unix:/tmp/thin.1.sock; } <% hostname = hostnames.split('_')[0] %> server { listen 443; #ssl on; #ssl_certificate /etc/ssl/certs/https.pem #ssl_certificate_key /etc/ssl/private/https.pem server_name <%= hostnames %>; access_log /var/log/nginx/<%= hostname %>/access.log; root /var/www/<%= hostname %>/public; error_page 500 502 504 /500.html; if ($request_method !~ ^(GET|HEAD|PUT|POST|DELETE|OPTIONS)$ ){ return 405; } #if ($host = '<%#= subhostname %><%= hostname %>' ) { # rewrite ^/(.*)$ http://<%= '' %><%= hostname %>/$1 permanent; #} location ~* \.(gz|ico|pdf|jpg|jpeg|gif|png|css|js|swf|html)$ { if (-f $request_filename) { expires max; break; } } #location / { # @cluster; #} location @cluster { proxy_pass http://thin_cluster; } }