Wednesday, October 1, 2014

404 when accessing a subdirectory from nginx

I deployed an ASP.NET MVC application on Ubuntu + nginx + fastcgi-mono-server4, this works:

http://www.example.com/


However this doesn't:

http://www.example.com/Companies/Search?q=softwaremint


The fix is apparently simple, instead of letting nginx manage the subdirectories, let ASP.NET MVC manage it by removing the following (configuration is in /etc/nginx/sites-available/default) :

try_files $uri $uri/ =404;

No comments:

Post a Comment