Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
Last active September 22, 2024 05:55
Show Gist options
  • Save nginx-gists/141d325deca301706c2394a06b2eb364 to your computer and use it in GitHub Desktop.
Save nginx-gists/141d325deca301706c2394a06b2eb364 to your computer and use it in GitHub Desktop.
Our Roadmap for QUIC and HTTP3 Support in NGINX
# Builds NGINX from the QUIC+HTTP/3 development branch
# - Based on the official NGINX docker image, including all modules built by default
# - OpenSSL replaced with LibreSSL to support QUIC's TLS requirements (statically linked)
#
# docker build --no-cache -t nginx:quic .
# docker run -d -p 443:443 -p 443:443/udp nginx:quic
#
# Note that a suitable configuration file and TLS certificates are required for testing!
# See <https://quic.nginx.org/readme.html> for more info
FROM nginx AS build
WORKDIR /src
RUN apt-get update && apt-get install -y git gcc make autoconf libtool perl
RUN git clone -b v3.6.1 https://github.com/libressl-portable/portable.git libressl && \
cd libressl && \
./autogen.sh && \
./configure && \
make check && \
make install
RUN apt-get install -y mercurial libperl-dev libpcre3-dev zlib1g-dev libxslt1-dev libgd-ocaml-dev libgeoip-dev
RUN hg clone -b quic https://hg.nginx.org/nginx-quic && \
cd nginx-quic && \
auto/configure `nginx -V 2>&1 | sed "s/ \-\-/ \\\ \n\t--/g" | grep "\-\-" | grep -ve opt= -e param= -e build=` \
--with-http_v3_module --with-stream_quic_module \
--with-debug --build=nginx-quic \
--with-cc-opt="-I/src/libressl/build/include" --with-ld-opt="-L/src/libressl/build/lib" --with-ld-opt="-static" && \
make
FROM nginx
COPY --from=build /src/nginx-quic/objs/nginx /usr/sbin
RUN /usr/sbin/nginx
EXPOSE 80 443 443/udp
@arch-user-france1
Copy link

ok

@arch-user-france1
Copy link

auto/configure: error: no /build/nginx-DUpigx/nginx-1.18.0/debian/modules/http-geoip2/config was found

@arch-user-france1
Copy link

arch-user-france1 commented Oct 11, 2021

how old is this? ah three months

@txone
Copy link

txone commented Dec 31, 2021

auto/configure: error: invalid option "--with-http_quic_module"

@ouch-digital
Copy link

also receiving auto/configure: error: invalid option "--with-http_quic_module"

@Sharaf5
Copy link

Sharaf5 commented Oct 4, 2022

same error

auto/configure: error: invalid option "--with-http_quic_module"

@JoshuaRVONQ
Copy link

same error

auto/configure: error: invalid option "--with-http_quic_module"

10 months ago this was changed: https://hg.nginx.org/nginx-quic/rev/44553428288d

So drop the '--with-http_quic_module' part and it will work.

@ouch-digital
Copy link

ouch-digital commented Oct 6, 2022

same error

auto/configure: error: invalid option "--with-http_quic_module"

10 months ago this was changed: https://hg.nginx.org/nginx-quic/rev/44553428288d

So drop the '--with-http_quic_module' part and it will work.

@JoshuaRVONQ Thank you! There was a comment https://www.nginx.com/blog/our-roadmap-quic-http-3-support-nginx/ which gave me a clue, but thank you for clarifying. All working now! :)

@nginx-gists
Copy link
Author

For a discussion of these files, see Our Roadmap for QUIC and HTTP3 Support in NGINX

@nginx-gists
Copy link
Author

The Dockerfile was updated on 2022-11-16. Among other changes, the obsolete --with-http_quic_module parameter was removed.

@Karthikdasari0423
Copy link

Karthikdasari0423 commented May 23, 2023

@nginx-gists @nginx-gists

root@ubuntu:/src/nginx-quic# auto/configure nginx -V 2>&1 | sed "s/ \-\-/ \\\ \n\t--/g" | grep -v -e 'http-geoip2' | grep "\-\-" | grep -ve opt= -e param= -e build= --build=nginx-quic --with-debug --with-stream_quic_module --with-http_v3_module --with-cc-opt="-I/src/boringssl/include" --with-ld-opt="-L/src/boringssl/build/ssl -L/src/boringssl/build/crypto"
auto/configure: error: invalid option "--with-stream_quic_module"
root@ubuntu:/src/nginx-quic#

@Karthikdasari0423
Copy link

auto/configure: error: no /build/nginx-DUpigx/nginx-1.18.0/debian/modules/http-geoip2/config was found

auto/configure nginx -V 2>&1 | sed "s/ \-\-/ \\\ \n\t--/g" | grep -v -e 'http-geoip2' | grep "\-\-" | grep -ve opt= -e param= -e build= --build=nginx-quic --with-debug --with-http_v3_module --with-stream_quic_module --with-cc-opt="-I/src/boringssl/include" --with-ld-opt="-L/src/boringssl/build/ssl -L/src/boringssl/build/crypto"

@Karthikdasari0423
Copy link

@nginx-gists @nginx-gists

root@ubuntu:/src/nginx-quic# auto/configure nginx -V 2>&1 | sed "s/ \-\-/ \\\ \n\t--/g" | grep -v -e 'http-geoip2' | grep "\-\-" | grep -ve opt= -e param= -e build= --build=nginx-quic --with-debug --with-stream_quic_module --with-http_v3_module --with-cc-opt="-I/src/boringssl/include" --with-ld-opt="-L/src/boringssl/build/ssl -L/src/boringssl/build/crypto" auto/configure: error: invalid option "--with-stream_quic_module" root@ubuntu:/src/nginx-quic#

removed this in https://hg.nginx.org/nginx/rev/113e2438dbd4

@alessfg
Copy link

alessfg commented May 25, 2023

Hi there @Karthikdasari0423! Thanks for catching this bug! I have great news to share -- as of today, with NGINX 1.25.0, you can get an NGINX image with HTTP3 support by simply downloading our latest Docker image! 😄

@Karthikdasari0423
Copy link

Hi @alessfg Thank your for the update.
I will try to do that.

@ManfredHu
Copy link

thanks for @Karthikdasari0423 and @nginx-gists , it's works.

@Karthikdasari0423
Copy link

Hi @alessfg @ManfredHu @nginx-gists
anyidea about below

Is there any config where i can configure nginx to supoort file upload using http3

I tried below config but still getting error with curl
am i missing anything here
location / {

required for browsers to direct them into quic port

add_header Alt-Svc 'h3=":$server_port"; ma=86400';
#add_header Alt-Svc 'h3=":8443"; ma=86400';

signal whether we are using QUIC+HTTP/3

add_header X-protocol $server_protocol always;
}
location "/root/([0-9a-zA-Z-.]*)$"{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Host $host;
dav_methods PUT DELETE MKCOL COPY MOVE;
client_body_temp_path /tmp;
alias /root/$1;
create_full_put_path on;
dav_access group:rw all:r;
client_body_in_file_only on;
client_body_buffer_size 100M;
client_max_body_size 100M;
proxy_pass_request_headers on;
proxy_set_body $request_body_file;
proxy_pass ​http://127.0.0.1/root/;
proxy_redirect off;
}
error_page 405 =200 $uri;
}
}
Curl output
We are completely uploaded and fine
< HTTP/3 404
< server: nginx/1.23.4
< date: Tue, 20 Jun 2023 19:28:53 GMT
< content-type: text/html
< content-length: 153
< x-protocol: HTTP/3.0
<

<title>404 Not Found</title>

404 Not Found


nginx/1.23.4 Connection #0 to host 172.16.3.1 left intact root@ubuntu:/var/www/html#

Could someone please help me with the nginx config to upload a file using curl.

@alessfg
Copy link

alessfg commented Jun 20, 2023

Hey @Karthikdasari0423 -- you are not very likely to get real help figuring out your issue in here. I would suggest joining the NGINX Community Slack and asking there -> https://community.nginx.org/joinslack

@Karthikdasari0423
Copy link

Hi @alessfg

Thank you for suggestion.

i solved the issue and able to upload file now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment