Running dotnet core 2.0 mvc application on cloud9


#1

I am trying to run a dotnet core 2.0 MVC application on cloud9. The steps I’ve taken is;

  1. Installed the dotnet core SDK according to https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.2-sdk-download.md#ubuntu-1404-and-linux-mint-17
  2. Created a new MVC / React app using the cli: dotnet new reactredux
  3. Ran npm i and dotnet restore
  4. Changed port of application in Program.cs to http://localhost:8080
  5. Ran the application: dotnet run

The console shows that the application is running, but I cannot access it though the browser, so I guess there is some issue with forwarding the request from c9 to the MVC application. Should I use nginx for this, or is there a better way to achive this?

Thanks / AS


#2

You can use an nginx reverse proxy if you want, but it’s easier to just change localhost to 0.0.0.0 (this is stored in the $IP environment variable, FYI). This will tell your server to listen on the external port rather than internally, so that the Cloud9 proxy can connect to it.


#3

@dannytech

Thanks!

I did try with 0.0.0.0:8080 previously, but it errored out with something like “not a valid url”, I tried using http://0.0.0.0:8080 now and it works!

Thanks again.

*EDIT: For future googlers: you need to make your application publically awailable for AJAX to work