使用单声道将ASP.NET部署在CentOS中



我想部署在Aspnet 4.0框架应用程序中内置的解决方案,该开发是在Windowsso/iis中完成的。

现在,我需要使用AS NGINX Web服务器部署在操作系统CentOS上。

我正在使用Centos-6.8,Nginx-1.10和Mono-4.6.1.5。

我的nginx配置文件是:

server {
    listen       80 default_server;
    listen       [::]:80 default_server;
    server_name  _;
    root /usr/share/nginx/html;
    #root /usr/share/nginx/html/Site;        
    location / {
        index index.aspx index.html index.htm index.aspx default.aspx Default.aspx Global.asax;
        fastcgi_index Global.asax;
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
    }
   ...
}

文件fastcgi_params我包括:

fastcgi_param  PATH_INFO          "";
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

开始服务单声道

fastcgi-mono-server4 /applications=/:/usr/share/nginx/html /socket=tcp:127.0.0.1:9000 &

i访问http://localhost/default.aspx进行测试,如果显示结果。

问题是访问网站文件夹http://localhost/site/,显示以下消息:

System.Web.HttpException
This type of page is not served.
Description: HTTP 403.The type of page you have requested is not served because it has been explicitly forbidden. The extension '.asax' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Details: Requested URL: /Site/Global.asax
Exception stack trace:
  at System.Web.HttpForbiddenHandler.ProcessRequest (System.Web.HttpContext context) [0x00073] in <d3ba84a338d241e2ab5397407351c9cd>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00dd7] in <d3ba84a338d241e2ab5397407351c9cd>:0 
  at System.Web.HttpApplication.Tick () [0x00000] in <d3ba84a338d241e2ab5397407351c9cd>:0

NGINX用户在网站文件夹上具有特权,可能会在Web.config中缺少某些依赖性,任何想法吗?谢谢。

听起来好像有一个权限问题。请检查网站上的权限为755。如果不是,请'sudo chmod -r 755'该文件夹。

一些进一步的阅读。

https://askubuntu.com/questions/9402/what file-permissions-should-i-set-nould-i-set-on-web-root

最新更新