Configuring nginx
My app sitting in /var/webapi
My config sitting in /etc/nginx/sites-available/webapi
server { listen 80; xxxxx-xxx.members.linode.com;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
} }
I am running my webapi in port 5000:
Me@ubuntu:~$ dotnet /var/webapi/WebApi.dll
Hosting environment: Production
Content root path: /home/Me
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
When I am navigating xxxxx-xxx.members.linode.com the browser I am getting 404 error - no any page displayed
Need help.
1 Reply
A 404 error typically means that your web server is not able to locate the file that should be served at that location. This error points to an issue with the internal configuration of your server.
These links attached below might help you:
https://www.linode.com/community/questions/17908/getting-a-404-error-message-from-nginx (outlines where to begin when handling a 404 error)
https://www.linode.com/docs/guides/how-to-install-and-use-nginx-on-ubuntu-20-04/ (shows you how to install NGINX on your server and how to get started using it.You can change distribution that you're using)
https://www.linode.com/docs/products/compute/compute-instances/guides/troubleshooting-services/#frequent-error-codes (outlines some resources for troubleshooting this sort of issue for Nginx.)