【发布时间】:2011-07-24 18:03:58
【问题描述】:
我已经在我的 Linux 服务器上安装了mono 平台,并且能够在 nginx HTTP 服务器后面运行它。该系统运行良好,并且完美地服务于 .NET 特定的动态文件。
但是,我只想(并且仅)将所需的文件(通过扩展名)传递给 mono,并让 nginx 处理所有其他文件,包括静态文件和在 .NET 平台上正常情况下不应提供的文件。我已经配置了我的 nginx,如下所示 - 因为我对 .NET 平台没有足够的知识 - 我不确定哪些扩展 should 必须传递给 mono 以及哪些扩展必须被禁止。
这里是我的nginx配置文件的相关部分:
# Do not pass .NET forbidden extensions to anywhere.
# Theese are the extensions that should not be served to the clients
location ~ \.(config|dbml|dll|master|other|forbidden|exts)$ {
deny all;
}
这里是将需要(仅需要)文件传递给单声道的配置部分:
# Theese are the extensions which *must* be handled by mono
location ~ \.(aspx|cs|other|exts|that|must|be|handled|by|mono)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
fastcgi_index default.aspx;
}
# Other static files will be handled by nginx.
我从 Wikipedia entry 中找到了一些 .NET 特定的文件扩展名,但它们还远未完成。
所以我的问题有三个子问题:
- .NET 平台特定的文件扩展名是什么?
- 其中哪些必须由 .NET 引擎处理?
- 其中哪些是保密的,不得提供给客户?
这将是一个共享托管环境,因此任何缺少的扩展都可能对用户造成不良影响(例如,泄露的用户密码或应用程序设置)。
【问题讨论】:
标签: .net asp.net mono nginx file-extension