Nginx运行Mono Web (ASP.NET)
2015-01-06 10:38
435 查看
Mono Web除了可以使用Apache/mod_mono方式承载运行外,还可以使用Nginx/FastCGI方式运行。
Nginx配置asp.net更简单方便,用处也多,可以通过FastCGI运行asp.net, php等,通过反向代理做负载均衡,也可运行python web.
以Ubuntu为例
配置nginx (/etc/nginx/sites-available/default),让站点根目录以FastCGI方式运行
编辑/etc/nginx/fastcgi_params
安装fastcgi-mono-server4模块
运行FastCGI Mono
注:applications={URL访问地址Path}:{物理路径},与上面的nginx config一致,URL访问地址可以使用域名。如此地址配置错误,会报异常"No Application Found"匹配不到
关于Nginx的URL Rewrite,参考,规则也可以放到一个单独的文件。
Nginx配置asp.net更简单方便,用处也多,可以通过FastCGI运行asp.net, php等,通过反向代理做负载均衡,也可运行python web.
以Ubuntu为例
配置nginx (/etc/nginx/sites-available/default),让站点根目录以FastCGI方式运行
server { listen 80; root /usr/share/nginx/www; index index.html index.htm; server_name localhost; access_log /var/log/nginx/chat.log; location / { root /var/www/chat; index default.aspx default.html; fastcgi_index Default.aspx; fastcgi_pass 127.0.0.1:8099; include /etc/nginx/fastcgi_params; } }
编辑/etc/nginx/fastcgi_params
fastcgi_param PATH_INFO ""; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
安装fastcgi-mono-server4模块
apt-get install fastcgi-mono-server4
运行FastCGI Mono
fastcgi-mono-server4 /applications=/:/var/www/chat/ /socket=tcp:127.0.0.1:8099
# just via domain visit fastcgi-mono-server4 /applications=www.domain.com:/:/var/www/chat/ /socket=tcp:127.0.0.1:8099
注:applications={URL访问地址Path}:{物理路径},与上面的nginx config一致,URL访问地址可以使用域名。如此地址配置错误,会报异常"No Application Found"匹配不到
关于Nginx的URL Rewrite,参考,规则也可以放到一个单独的文件。
相关文章推荐
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net
- 在Windows系统中用nginx与mono搭建asp.net运行环境,附详细例图与代码
- CentOS上搭建Nginx+Mono运行asp.net环境的配置方法
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS搭建Nginx+Mono运行ASP.NET环境
- CentOS Linux上搭建 Nginx+Mono 运行 ASP.NET
- CentOS上搭建Nginx + Mono 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net
- Ubuntu Server Nginx 下配置 mono 下运行 asp.net mvc
- CentOS 6.0 安装 Mono + Nginx 运行 asp.net
- CentOS上搭建Nginx + Mono 运行 asp.net[转]
- "VS.NET Web服务器运行的不是ASP.NET 1.1 版"的解决办法
- 试图运行项目时出错:无法在 Web 服务器上启动调试。未能启动 ASP.NET 或 ATL Server 调试。
- 关于"visual stadio.net已检测到web服务器运行的不是asp.net1.1版"的错误
- "VS.NET Web服务器运行的不是ASP.NET 1.1 版"的解决办法
- mono:Xsp,在linux平台上运行asp.net