ASP.Net MVC 2 on nginx/mono 2.8

前端 未结 6 1477
心在旅途
心在旅途 2021-02-06 07:07

I am trying to setup ASP.Net MVC 2 application on Linux environment. I\'ve installed Ubuntu 10.10 on VirtualBox, then installed Mono 2.8 from sources. After that I have installe

相关标签:
6条回答
  • 2021-02-06 07:38

    Adding following line in /etc/nginx/fastcgi_param resolves the issue for me. It also allows to use multiple virtual hosts.

    fastcgi_param HTTP_HOST $host;
    
    0 讨论(0)
  • 2021-02-06 07:40

    Since you are running ASP.NET MVC 2 application you should use fastcgi-mono-server4.

    0 讨论(0)
  • 2021-02-06 07:41

    You need to make sure the domain set in your site config matches the domain passed to the fastcgi server. So for example if your default site (/etc/nginx/sites-enabled/default) has the following config:

    server {
        ...
        server_name www.domain1.xyz;
        ...
    }
    

    You would need to pass that domain into the fastcgi server:

    sudo fastcgi-mono-server4 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ ...
    

    Then when you access the site it will obviously need to be with that domain you set.

    0 讨论(0)
  • 2021-02-06 07:45

    I had this problem just now, I too had been following the document on the mono site:

    I was trying to start the fastcgi-mono-server as it suggested:

    sudo fastcgi-mono-server4 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 &
    

    However when I did it like that I got the same problem as you. I changed it to this:

    sudo fastcgi-mono-server4 /applications=/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000 &
    

    And it worked ( I had to type in www.domain1.xyz/Home/Index to see my MVC page, not worked out how to stop it looking for www.domain1.xyz/default.aspx yet XD ).

    0 讨论(0)
  • 2021-02-06 07:49

    Does your application work with xsp (xsp4 if you are using .net 4.0)? You'll want to make sure that is working before you try configuring the connection to another web server.

    Does nginx know where to find mono? You most likely have a parallel install and it won't be in the default paths.

    I use apache, but you may still find some of the instructions on my blog useful: http://tqcblog.com/2010/04/02/ubuntu-subversion-teamcity-mono-2-6-and-asp-net-mvc/

    0 讨论(0)
  • 2021-02-06 07:54

    I've been doing some testing with this as well, using all ubuntu10.10 binaries. From what I can make from it, either nginx fails to pass the hostname of the mono server fails to receive it over the fastcgi protocol. Anyhow, the tutorial line:

     fastcgi-mono-server2 /applications=www.domain1.xyz:/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000
    

    doesn't work. Removing the hostname makes the thing work:

     fastcgi-mono-server2 /applications=/:/var/www/www.domain1.xyz/ /socket=tcp:127.0.0.1:9000
    

    but this of course blocks the use of multiple virtual mono hosts.

    0 讨论(0)
提交回复
热议问题