I have a Web API that is using .NET 4.0 which I'm now trying to deploy on Debian.
I've followed a few tutorials on how to do this, e.g. Running ASP.net Web API Services under Linux and OSx.
$ /etc/nginx/sites-available/default:
server {
listen 80;
root /var/www/API/;
index index.html index.htm default.aspx Default.aspx index.cshtml Index.cshtml;
server_name localhost;
location / {
fastcgi_index Index.cshtml;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}
I added the following to /etc/nginx/fastcgi_params:
fastcgi_param PATH_INFO "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Then I started nginx and the mono server:
# /etc/init.d/nginx start
# fastcgi-mono-server4 /applications=/localhost:/var/www/API/ /socket=tcp:127.0.0.1:9000 /verbose=True
Then when I try to access the site the log gives warnings and errors that I've failed to find a solution for:
Warning: Duplicate name, SCRIPT_FILENAME, encountered. Overwriting existing value.
Error: No application defined for: localhost:80/Index.cshtml