0

I have a single solution with 2 projects - https://github.com/vickyrathee/dotnet-test-app

  1. My Website: dotnet-test-website (domain.com)
  2. My API: dotnet-test-api (api.domain.com)

How can I configure my projects to be deployed on single Ubuntu/Amazon linux server?

I already tried using the Urls option on appsettings.json to set port 5001 for API project and 5002 for website project as mentioned here

https://github.com/vickyrathee/dotnet-test-app/blob/master/dotnet-test-app/appsettings.json

{
  "Urls" :  "http://localhost:5001"
}

But as per the EB logs, it seems to trying port 5000 instead what I defined in appsettings.json

----------------------------------------
/var/log/nginx/error.log
----------------------------------------
2021/02/14 09:11:24 [error] 3583#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"
2021/02/14 09:11:39 [error] 3583#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"
2021/02/14 09:11:54 [error] 3583#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"

Additionally, how to publish it correctly in separate folders, So that there are no conflict between them. EB allow single zip file upload with appsettings.json on root, while I have two with some other files as well in common and can't just put them on single directory to zip. Any help will be appreciated.

Vikash Rathee
  • 1,776
  • 2
  • 25
  • 43
  • Nginx on EB uses port 5000 by [defaut](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/dotnet-linux-platform-nginx.html). You can use ` PORT` env variable to change that. – Marcin Feb 14 '21 at 10:39
  • @Marcin I can't use PORT env variable because I want to deploy multiple projects on same server....so setting env variable will just map to one. – Vikash Rathee Feb 14 '21 at 11:18

0 Answers0