【问题标题】:asp mvc home root not working with mono, fastcgi and nginxasp mvc home root 不适用于 mono、fastcgi 和 nginx
【发布时间】:2011-02-09 14:18:31
【问题描述】:

我有单声道 2.6.7,我正在尝试移植一个 ASP.NET MVC 应用程序。我设法通过设置变量 MONO_IOMAP=all 解决了区分大小写的问题。我还有一个问题,我的家庭根无法正常工作。我收到一个找不到页面的错误(尽管 /home 和 /home/index 有效)。我正在使用 nginx 和 fastcgi。这是我对 nginx 的配置:

server {
    listen       80;
    server_name  mydomain.com;
    access_log   /var/log/nginx/mydomain.com.log;

    location / {
        root  /home/ec2-user/www/mydomain-web/;
        index  index.html index.htm default.aspx Default.aspx;
        fastcgi_index Default.aspx;
        fastcgi_pass 127.0.0.1:9000;
        include /etc/nginx/fastcgi_params;
    }

【问题讨论】:

    标签: asp.net-mvc mono nginx


    【解决方案1】:

    This 最终为我工作。

    server {
        listen       80;
        server_name  mydomain.com;
        access_log   /var/log/nginx/mydomain.com.log;
    
        location / {
            root  /home/ec2-user/www/mydomain-web/;
            fastcgi_index /;
            fastcgi_pass 127.0.0.1:9000;
            include /etc/nginx/fastcgi_params;
    }
    

    我完全删除了索引行并将 fastcgi_index 更改为fastcgi_index /;。使用 Mono 3.0.3/ASP.NET MVC3。

    【讨论】:

      【解决方案2】:

      更改 fastcgi_index Default.aspx;

      fastcgi_index /Home;

      【讨论】:

      • 或者更好,完全删除 fastcgi_index 行
      猜你喜欢
      • 2014-08-22
      • 1970-01-01
      • 1970-01-01
      • 2019-12-11
      • 2021-11-14
      • 2012-02-21
      • 2013-04-10
      • 2016-04-21
      • 1970-01-01
      相关资源
      最近更新 更多