How can we do the below Nginx configuration in Apache?
Basically proxying to a Unix socket instead of a load balanced port.
I want that Unicorn handle the load balancing instead of Apache.
upstream unicorn_server {
server unix:/home/prats/public_html/myapp/current/tmp/sockets/unicorn.sock
fail_timeout=0;
}
server {
...
...
...
location / {
...
...
# If you don't find the filename in the static files
# Then request it from the unicorn server
if (!-f $request_filename) {
proxy_pass http://unicorn_server;
break;
}
...
...
}
}
ProxyRequests Off
ProxyPass /stylesheets/ !
ProxyPass /javascripts/ !
ProxyPass /images/ !
ProxyPass / http://example.com:8080/
ProxyPassReverse / http://example.com:8080/