By samynmhd
Here is my Nginx config.
server {
listen 80;
server_name 139.59.90.155; 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;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /manage {
proxy_pass http://127.0.0.1:5000/manage;
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;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
I am able to curl to the dotnet application inside the droplet. But refuses to connect via a browser.
- Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
- tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12063/nginx: master
- tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 640/systemd-resolve
- tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 820/sshd
- tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 10928/dotnet
- tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN 10928/dotnet
- tcp 0 340 139.59.90.155:22 83.137.200.73:63066 ESTABLISHED 3082/sshd: root@pts
- tcp 0 1080 139.59.90.155:22 222.186.42.155:53686 ESTABLISHED 12043/sshd: [accept
- tcp6 0 0 :::22 :::* LISTEN 820/sshd
- tcp6 0 0 ::1:5000 :::* LISTEN 10928/dotnet
- tcp6 0 0 ::1:5001 :::* LISTEN 10928/dotnet
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @samynmhd:
I managed to fix, just hand to change the Progam.cs file. Added UseUrls() and its working now.
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>().UseUrls("http://*:5000"); });
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.