Mono and Nginx Setup on Ubuntu 14.04
I had a problem with Apache and Mono in Ubuntu 14.04 LTS (which is a nice distro, but I think a rush job)....so I'm trying to hold onto 12.04 LTS....but it's showing it's age...
First - Do the Following
apt-get update
apt-get upgrade
apt-get install nginx
apt-get install mono-complete
Second - /etc/nginx/nginx.conf should be just fine for your default install. Just remember that pages are served from /usr/share/nginx/html (how about some standards people - kinda tired of everybody doing there own thing). Anyway setup /etc/nginx/sites-enabled/default as follows
server {
listen 80;
listen [::]:80 ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm default.aspx Default.aspx;
server_name www.servername.com;
location / {
root /usr/share/nginx/html;
index default.aspx Default.aspx;
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}
# HTTPS server
#server {
# listen 443;
# server_name www.servername.com;
#
# root html;
# index index.html index.htm default.aspx Default.aspx;
#
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_timeout 5m;
#
# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
# ssl_prefer_server_ciphers on;
#
# location / {
# root /usr/share/nginx/html;
# index default.aspx Default.aspx;
# fastcgi_index Default.aspx;
# fastcgi_pass 127.0.0.1:9000;
# include /etc/nginx/fastcgi_params;
# }
#}
Third - Dump your ASP.Net application to /usr/share/nginx/html
Fourth - Start nginx by typing "/etc/init.d/nginx start"
Lastly - Fire up the fastCGI and Mono code to handle compilation
fastcgi-mono-server /root=/usr/share/nginx/html /socket=tcp /applications=*:80:/:.,*:443:/:. /port=9000 /address=127.0.0.1 /appconfigfile=Web.config