As I outlined in my previous post on using Mono with FastCGI and Nginx, I’m hosting multiple ASP.Net applications with Mono. I already have Nginx configured to automatically direct subdomains of quickpm.net to the fastcgi-mono-server2 program using the fastcgi protocol.
I also have the fastcgi-mono-server2 configured using the following options
fastcgi-mono-server2 /applications=cmd.quickpm.net:/:/usr/local/nginx/html/cmd.quickpm.net,quickpm.net:/:/usr/local/nginx/html/quickpm.net /socket=tcp:127.0.0.1:9000
To quickply explain, the /applications argument is setting the cmd.quickpm.net domain to be served by the directory /usr/local/nginx/html/cmd.quickpm.net, and the other sites are set to their respective directories. The /socket option is telling fastcgi-mono-server2 to listen using the tcp protocol on port 9000 of the local host.
My only problem is that adding new subdomains is not automatic. If I want to add a new subdomain to my website I have to shutdown the mono fastcgi server and restart it with the subdomain added to the /applications argument, I could use a config file instead of the command line option but the point is I have to shut the server down and restart it to add subdomains. I want avoid doing this. What I want is an option like the following /applications=%1.quickpm.net:/:/usr/local/nginx/html/%1.quickpm.net so all subdomains are automatically handled.
The only way to do what I want, I believe, is to patch the mono xsp2 source code.