0

I'm interested in serving multiple .Net sites using Nginx for the front end proxying to fastcgi-server. I would like to know if its possible to support 2 sites on a single fastcgi-mono-server4 port (9000) or if the accepted practice to is to create a port for each site? When specifying a webapp file there seems to be nowhere to specify whether to use 9000 or 9001 so I'm confused unless you can specify a pool of fastcgi processes. I found when attempting 2 sites on Port 9000 using a webapp configuration file with 2 hosts... the same site was served on both urls.

Thanks

MikeW
  • 4,749
  • 9
  • 42
  • 83

1 Answers1

0

Yes. The fastcgi-mono-server4(mono 3.12.1) can take more than one webapp in single proc.

It seems that the fastcgi-mono-server only use the vhost+vport+vpath to match the webapp node defined in .webapp file.

  1. Setup two webapp in different port 80 vs. 81

my_nginx.conf

server {
    listen       80;
    server_name  localhost;
    location / {
        root /home/test/www;
        index index.html Default.aspx;
        fastcgi_pass 127.0.0.1:9000;
        include /etc/nginx/fastcgi_params;
    }
}
server {
    listen       81;
    server_name  localhost;

    location / {
        root /home/test/www2;
        index index.html Default.aspx;
        fastcgi_pass 127.0.0.1:9000;
        include /etc/nginx/fastcgi_params;
    }
}
  1. two.webapp

it contains 2 webapp nodes

<apps>
    <web-application>
        <name>www</name>
        <vhost>*</vhost>
        <vport>80</vport>
        <vpath>/</vpath>
        <path>/home/test/www/</path>
        <enabled>true</enabled>
    </web-application>
    <web-application>
        <name>www2</name>
        <vhost>*</vhost>
        <vport>81</vport>
        <vpath>/</vpath>
        <path>/home/test/www2/</path>
        <enabled>true</enabled>
    </web-application>
</apps>

I just tested use the vport to distinct them, and succeed. I think using vhost or vpath or any combination of vhost+vport+vpath should worked.

  1. start the fastcgi server

listening in 9000 port.

fastcgi-mono-server4 --appconfigfile=./two.webapp /socket=tcp:127.0.0.1:9000
Bear Vast
  • 150
  • 1
  • 8