Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Linux + nginx + subfolder

$
0
0

Hi,

The new version of our platform wEngine is using asp.net core 1.0 and  works under Linux (Debian Jessie + nginx).

We are now working to have our platform be install-able in a subfolder, for example: 

URL: domain.com/applicationname

NGINX Configuration: location /applicationname

What we want to achieve

  • We want to install multiple applications under the same domain (domain.com)
  • We want the url's to be like:  domain.com/app1, domain.com/app2
  • We want to be able to use the same port for all applications

Our Problem

We can configure nginx for serving domain.com/app1 and forwarding to the asp.net applicationapp1 
but asp.net routing gets confused with a subfolder in the url.  It will get different routes depending on url:

  • domain.com
  • domain.com/app1

One solution may be to programmatically create routes like:

var appname="app1/";  //From configuration, Develop/Staging/Production
var route=appname+"{controller=home}/{action=index}/{id?}"
But I don't know if its a good solution.

What is the recommended best practice in this scenario with Linux and nginx?

Thanks! Best Regards

weboholics.se


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>