Unix Domain Sockets between Nginx and TurboGears
Filed under: nginx turbogearsI decided to check once again if there remained a bug with specifying Unix domain sockets in the TurboGears configuration (we're on our third configuration system, so it seemed reasonable to think a bug or two might have gotten shaken out at some point ;-)
And apparently it did (or perhaps the note I make at the end of this article is why I've gotten it to work this time and failed previously).
Nginx configuration:
upstream mycluster {
server unix:/path/to/socket-1;
server unix:/path/to/socket-2;
# ...
}
server {
# ...
location / {
proxy_pass http://mycluster;
}
}
TurboGears configuration:
server.socket_port="" server.socket_file="/path/to/socket-1"
Repeat the above configuration in separate config files for each backend you want.
Note that it's necessary to set server.socket_port="" or else someone (TurboGears), somewhere sets it to a default value of 8080. This wouldn't matter except it's how CherryPy determines whether or not we want a domain socket vs a TCP port.







Don't blame tg when it's cherrypy's fault. see http://www.cherrypy.org/ticket/557 . try to use the attached patch and see if it works then.
Ohter then that. I like the idea to use sockets to run tg on. will try it out :)