I have installed mono platform on my Linux server and I was able to run it behind nginx HTTP server. The system is working well and serving .NET specific dynamic files flawlessly.
However, I want to pass only (and only) required files (by extension) to mono and let nginx handle all the other files including static files and the files that should not be served in normal circumstances on .NET platform. I have configured my nginx as seen below but – since I don’t have enough knowledge about .NET platform – I am not sure which extensions should must be passed to mono and which ones must be forbidden.
Here is the related part of my nginx configuration file:
# 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;
}
And here is the configuration part that will pass required (only required) files to mono:
# 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.
I have found some .NET specific file extensions from Wikipedia entry but they are far from complete.
So my question has three sub-questions:
- What are the .NET platform-specific file extensions?
- Which of them must be handled by .NET engine?
- Which of them confidential and must not be served to the clients?
This will be a shared hosting environment so any missing extension may result undesirable effects to user (eg. Revealed user passwords or application settings).
Probably the easiest place to look is the master web.config file, which is where base settings for ASP.NET are declared. This includes
<httpHandlers>, e.g.: