Welcome! Log In Create A New Profile

Advanced

Re: HTTP/3 with multiple server blocks

Jonny Barnes
November 02, 2020 03:16PM
Okay, progress, fyi for anyone adding HTTP/3 support, make sure your
server’s firewall has port 443 open for udp as well as tcp! :face_palm:

First server worked after opening the port

To get the second server I seemed to need to repeat myself slightly. I
needed:
> listen 443 http3;
> listen [::]:443 http3;
>
> listen 443;
> listen [::]:443;

Is this to get it to listen on both udp and tcp?

On Mon, 2 Nov 2020 at 20:00, Jonny Barnes <jonnybarnes@gmail.com> wrote:

> If I understand the link correctly, I want to only set options on the
> `default_server`.
>
> So I know have three vhosts setup, the first is a generic https redirector
> and looks like:
> >server {
> > listen 80;
> > listen [::]:80;
> > return 301 https://$host$request_uri;
> >}
>
> The next starts:
> >server {
> > listen 443 http3 default_server reuseport;
> > listen [::]:443 http3 default_server reuseport;
> >
> > listen 443 ssl http2;
> > listen [::]:443 ssl http2;
> >
> > server_name foo;
> >
> > add_header Alt-Svc '$http3=":443"; ma=15';
>
> And the second:
> >server {
> > listen 443;
> > listen [::]:443;
> >
> > server_name bar;
> >
> > add_header Alt-Svc '$http3=":443"; ma=15';
>
> The nginx config test passes, but everything is served over HTTP/2.
>
> Is there something obvious I’m missing here?
>
> On Mon, 2 Nov 2020 at 13:39, Sergey Kandaurov <pluknet@nginx.com> wrote:
>
>>
>> > On 30 Oct 2020, at 22:21, Jonny Barnes <jonnybarnes@gmail.com> wrote:
>> >
>> > Can we do this?
>> >
>> > First issue is if I add the line `listen 443 http3 resueport` to more
>> than one server {} block the nginx conf test gives the following error:
>> >
>> > > nginx: [emerg] duplicate listen options for 0.0.0.0:443 in
>> /usr/local/nginx/conf/sites-enabled/legolas:2
>> > > nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
>>
>> That's expected behaviour, see for detailed explanation:
>> https://trac.nginx.org/nginx/ticket/1912
>>
>> >
>> > It seemingly works if i only have it for one of my server blocks. But I
>> can‘t get my firefox browser to connect with HTTP/3. It does connect to
>> quic.nginx.org over HTTP/3.
>>
>> You may want to hint Firefox about QUIC protocol using Alt-Svc.
>>
>> --
>> Sergey Kandaurov
>>
>> _______________________________________________
>> nginx-devel mailing list
>> nginx-devel@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

HTTP/3 with multiple server blocks

Jonny Barnes 175 October 30, 2020 06:22PM

Re: HTTP/3 with multiple server blocks

Sergey Kandaurov 31 November 02, 2020 08:40AM

Re: HTTP/3 with multiple server blocks

Jonny Barnes 31 November 02, 2020 03:02PM

Re: HTTP/3 with multiple server blocks

Jonny Barnes 58 November 02, 2020 03:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready