.NET Exercise

Dependencies

Deploy Artifacts (GitHub)

You can find the artifacts for this project at the .NET Techjobs MVC artifacts GitHub repo .

Instructions

Using the project dependencies and the deploy artifacts:

  1. start the application server
  2. configure NGINX to serve as a reverse proxy to the running application server

Hints

Starting the Application Server

  1. Figure out how to start a .NET application with the dotnet CLI.
  2. Figure out how to start a .NET application with the executable script in the Project artifact directory.

NGINX Troubleshooting

  1. NGINX and Caddy can’t both be running as they conflict over the ports 80 and 443.
  2. Use the systemctl stop and start commands to ensure only NGINX is active.

Questions & Answers

How can the application server be started with the dotnet CLI?

CLICK FOR ANSWER
cd dotnet-techjobs-mvc-artifacts
dotnet TechJobsMVC.dll

Optionally you can invoke the script found in the artifact directory ./TechJobsMVC after changing into the project directory.

What port was the application server running on?

CLICK FOR ANSWER

The Kestrel server was running on: http://localhost:5000. Port 5000.

dotnet TechJobs.dll output dotnet TechJobs.dll output

Take note of the output in the picture where it mentions listening on http://localhost:5000.

What did the NGINX configuration need to contain to serve as a reverse proxy?

CLICK FOR ANSWER
server {
    listen 80;
    server_name localhost;

    location / {
        proxy_pass http://localhost:5000;
    }
}

What command was used to reload NGINX after a change was made to the configuration file?

CLICK FOR ANSWER
sudo nginx -s reload