1

I want to deploy a solution built in ASPnet 4.0 framework application, the development was done in WindowsSO / IIS.

Now I need deploy on a Operating System Centos using as NginX Web server.

I'm using Centos-6.8, Nginx-1.10 and mono-4.6.1.5.

My nginx configuration file is:

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;
    }
   ...
}

File fastcgi_params I include:

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

Start service mono

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

I access to http://localhost/Default.aspx for testing, if it shows result.

The problem is when access to the Site folder http://localhost/Site/, displays the following message:

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

The nginx user has privileges on the Site folder, may be missing some dependency in the Web.Config of the application, any ideas? Thank you.

1
  • Due to the architecture of the solution, we decided to use dotnet Commented Jan 21, 2017 at 19:13

1 Answer 1

2

It sounds like there is a permission issue. Please check do be sure that the permissions on the Site is 755. If not please 'sudo chmod -R 755' the folder.

Some further reading.

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

Sign up to request clarification or add additional context in comments.

1 Comment

The folder has 755 permissions, has the nginx user assigned, it will not be something from the Web.Config?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.