mirror of
https://github.com/yurymuski/nginx-http3.git
synced 2026-09-27 14:36:20 +00:00
Compare commits
9
Commits
ddfdd70904
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26130d1da8 | ||
|
|
23f424b839 | ||
|
|
c55df02f0d | ||
|
|
2655f98dee | ||
|
|
3cde573afd | ||
|
|
3bdbdb0e55 | ||
|
|
48b184cd32 | ||
|
|
de3337a5bc | ||
|
|
9e070a1318 |
@@ -0,0 +1,38 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Inject slug/short variables
|
||||||
|
uses: rlespinasse/github-slug-action@v4.x
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:${{ env.GITHUB_REF_SLUG }}
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:latest
|
||||||
+10
-5
@@ -3,21 +3,22 @@ FROM ubuntu:20.04 AS builder
|
|||||||
LABEL maintainer="Yury Muski <muski.yury@gmail.com>"
|
LABEL maintainer="Yury Muski <muski.yury@gmail.com>"
|
||||||
|
|
||||||
ENV NGINX_PATH /etc/nginx
|
ENV NGINX_PATH /etc/nginx
|
||||||
ENV NGINX_VERSION 1.19.6
|
ENV NGINX_VERSION 1.16.1
|
||||||
|
|
||||||
ENV QUICHE_VERSION 0.9.0
|
ENV QUICHE_VERSION 0.18.0
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre3 libpcre3-dev zlib1g-dev zlib1g golang-go build-essential git curl cmake;
|
DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre3 libpcre3-dev zlib1g-dev zlib1g golang-go build-essential libbrotli-dev git curl cmake;
|
||||||
|
|
||||||
RUN curl -O https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
|
RUN curl -O https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
|
||||||
tar xvzf nginx-$NGINX_VERSION.tar.gz && \
|
tar xvzf nginx-$NGINX_VERSION.tar.gz && \
|
||||||
git clone --branch $QUICHE_VERSION --recursive https://github.com/cloudflare/quiche && \
|
git clone --branch $QUICHE_VERSION --recursive https://github.com/cloudflare/quiche && \
|
||||||
|
cd /opt/quiche && git submodule update --init && cd /opt/ && \
|
||||||
git clone --recursive https://github.com/google/ngx_brotli.git && \
|
git clone --recursive https://github.com/google/ngx_brotli.git && \
|
||||||
cd nginx-$NGINX_VERSION && \
|
cd nginx-$NGINX_VERSION && \
|
||||||
patch -p01 < ../quiche/extras/nginx/nginx-1.16.patch && \
|
patch -p01 < ../quiche/nginx/nginx-1.16.patch && \
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y -q && \
|
curl https://sh.rustup.rs -sSf | sh -s -- -y -q && \
|
||||||
export PATH="$HOME/.cargo/bin:$PATH" && \
|
export PATH="$HOME/.cargo/bin:$PATH" && \
|
||||||
./configure \
|
./configure \
|
||||||
@@ -60,9 +61,10 @@ RUN curl -O https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
|
|||||||
--with-stream_realip_module \
|
--with-stream_realip_module \
|
||||||
--with-stream_ssl_module \
|
--with-stream_ssl_module \
|
||||||
--with-stream_ssl_preread_module \
|
--with-stream_ssl_preread_module \
|
||||||
|
--with-debug \
|
||||||
--add-module=/opt/ngx_brotli \
|
--add-module=/opt/ngx_brotli \
|
||||||
--with-http_v3_module \
|
--with-http_v3_module \
|
||||||
--with-openssl=/opt/quiche/deps/boringssl \
|
--with-openssl=/opt/quiche/quiche/deps/boringssl \
|
||||||
--build="quiche-$(git --git-dir=../quiche/.git rev-parse --short HEAD)" \
|
--build="quiche-$(git --git-dir=../quiche/.git rev-parse --short HEAD)" \
|
||||||
--with-quiche=/opt/quiche &&\
|
--with-quiche=/opt/quiche &&\
|
||||||
make && \
|
make && \
|
||||||
@@ -70,6 +72,9 @@ RUN curl -O https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
|
|||||||
|
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre3 libbrotli1
|
||||||
|
|
||||||
COPY --from=builder /usr/sbin/nginx /usr/sbin/
|
COPY --from=builder /usr/sbin/nginx /usr/sbin/
|
||||||
COPY --from=builder /etc/nginx/ /etc/nginx/
|
COPY --from=builder /etc/nginx/ /etc/nginx/
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ Nginx compiled with *BoringSSL* and *quiche* for *HTTP3* support, *Brotli* suppo
|
|||||||
|
|
||||||
## version
|
## version
|
||||||
|
|
||||||
nginx version: nginx/1.19.6 (quiche-ad9d933)
|
nginx version: nginx/1.16.1 (quiche-28ef289f)
|
||||||
quiche 0.9.0
|
quiche 0.18.0
|
||||||
|
|
||||||
Based on ubuntu:20.04, size 109MB
|
Link for [quiche + nginx manual](https://github.com/cloudflare/quiche/tree/master/nginx)
|
||||||
|
|
||||||
Link for [quiche + nginx manual](https://github.com/cloudflare/quiche/tree/master/extras/nginx)
|
|
||||||
|
|
||||||
### usage
|
### usage
|
||||||
- get certs from certbot in /etc/letsencrypt/
|
- get certs from certbot in /etc/letsencrypt/
|
||||||
@@ -25,9 +23,11 @@ docker run -it --rm --name certbot \
|
|||||||
|
|
||||||
- create nginx.conf like in example
|
- create nginx.conf like in example
|
||||||
|
|
||||||
`docker run --name nginx -d -p 80:80 -p 443:443/tcp -p 443:443/udp -v ${PWD}/temp/letsencrypt/:/opt/nginx/certs/ -v ${PWD}/nginx.conf:/etc/nginx/nginx.conf ymuski/nginx-quic`
|
```sh
|
||||||
|
# NOTE: --privileged needed for setsockopt(SO_TXTIME) access
|
||||||
|
docker run --name nginx --privileged -d -p 80:80 -p 443:443/tcp -p 443:443/udp -v ${PWD}/temp/letsencrypt/:/opt/nginx/certs/ -v ${PWD}/nginx.conf:/etc/nginx/nginx.conf ymuski/nginx-http3
|
||||||
|
```
|
||||||
|
|
||||||
`docker run --name nginx -d -p 80:80 -p 443:443/tcp -p 443:443/udp -v /etc/letsencrypt/:/opt/nginx/certs/ -v /opt/nginx/conf/example.nginx.conf:/etc/nginx/nginx.conf ymuski/nginx-quic`
|
|
||||||
|
|
||||||
### Checking
|
### Checking
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -51,7 +51,7 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Add Alt-Svc header to negotiate HTTP/3.
|
# Add Alt-Svc header to negotiate HTTP/3.
|
||||||
add_header alt-svc 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400';
|
add_header alt-svc 'h3=":443"; ma=86400';
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root html;
|
root html;
|
||||||
@@ -62,7 +62,7 @@ http {
|
|||||||
return 200 "http3 on $hostname";
|
return 200 "http3 on $hostname";
|
||||||
add_header Content-Type text/plain;
|
add_header Content-Type text/plain;
|
||||||
# Add Alt-Svc header to negotiate HTTP/3.
|
# Add Alt-Svc header to negotiate HTTP/3.
|
||||||
add_header alt-svc 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400';
|
add_header alt-svc 'h3=":443"; ma=86400';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user