© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•14mo ago•
1 reply
Cydo

✅ Can't get HTTPS to work for my api deployment.

I am following the Microsoft docs https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu step by step and I get the point where you set up nginx everything works when I'm on http, but the second i try to make anything go to https everything breaks, the connections time out and I can't get anything to work, I have no idea why.

No working HTTPS
server {
    listen 80;
    server_name questbound.xyz www.questbound.xyz;

    # Redirect all HTTP traffic to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name questbound.xyz www.questbound.xyz;

    # SSL Configuration
    ssl_certificate /etc/letsencrypt/live/questbound.xyz/fullchain.pem;  # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/questbound.xyz/privkey.pem;  # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf;  # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;  # managed by Certbot

    # Proxy to your backend API
    location / {
        proxy_pass http://0.0.0.0:5000;  # Ensure the API is running here
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
    }
}
server {
    listen 80;
    server_name questbound.xyz www.questbound.xyz;

    # Redirect all HTTP traffic to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name questbound.xyz www.questbound.xyz;

    # SSL Configuration
    ssl_certificate /etc/letsencrypt/live/questbound.xyz/fullchain.pem;  # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/questbound.xyz/privkey.pem;  # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf;  # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;  # managed by Certbot

    # Proxy to your backend API
    location / {
        proxy_pass http://0.0.0.0:5000;  # Ensure the API is running here
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Can't get `InternalsVisibleTo` to work
C#CC# / help
4y ago
MVC project. Can't get my create Book to work.
C#CC# / help
15mo ago
❔ Can't get the source generators tutorial to work
C#CC# / help
3y ago
Non HTTPS authentication doesn't work
C#CC# / help
2mo ago