Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #243056

Re: Nginx and ASP.Net Core

From Dan Ritter <dsr@randomstring.org>
Newsgroups linux.debian.user
Subject Re: Nginx and ASP.Net Core
Date 2021-12-13 13:40 +0100
Message-ID <DtSMy-5hm-5@gated-at.bofh.it> (permalink)
References <DtRGN-4Fe-1@gated-at.bofh.it> <DtSjv-57O-5@gated-at.bofh.it> <DtSjv-57O-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Patrick Kirk wrote: 
> On Mon, 13 Dec 2021 at 13:37, Dan Ritter <dsr@randomstring.org> wrote:
> 
> > Patrick Kirk wrote:
> >
> > 6. If serving dynamic content, where to get it
> >
> >
> > A program running on port 5000 is a fine place to serve dynamic
> > content from, but you haven't told nginx about it.
> >
> > I'll bet you that this "kestrel" program comes with
> > documentation about using a reverse proxy, which is what you
> > want nginx to do.
> >
> > -dsr-
> >
> Hi Dan,
> 
> Nginx is working well for items 1 to 6 on your list.  I followed this
> tutorial:
> https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-6.0
> 
> As you can see from the logs, there is no problem serving static files.
> 
> But I can't find how to tell nginx where to get dynamic content.

It's right in that tutorial:

 location / {
        proxy_pass         http://127.0.0.1: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;
    }

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Nginx and ASP.Net Core Patrick Kirk <patrick@kirks.net> - 2021-12-13 12:40 +0100
  Re: Nginx and ASP.Net Core Patrick Kirk <patrick@kirks.net> - 2021-12-13 13:10 +0100
    Re: Nginx and ASP.Net Core Dan Ritter <dsr@randomstring.org> - 2021-12-13 13:40 +0100
  Re: Nginx and ASP.Net Core Dan Ritter <dsr@randomstring.org> - 2021-12-13 13:10 +0100

csiph-web