From ad635d339cc654e110befa5f1270aa2107aac0ea Mon Sep 17 00:00:00 2001 From: konrad Date: Mon, 10 Jun 2019 22:12:58 +0200 Subject: [PATCH] Added support for HTTP/2 to the docker image --- Dockerfile | 10 ++++++++-- nginx.conf | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b1ffb21640..99a276e8e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,12 @@ FROM nginx MAINTAINER maintainers@vikunja.io +RUN apt-get update && apt-get install -y apt-utils openssl && \ + mkdir -p /etc/nginx/ssl && \ + openssl genrsa -out /etc/nginx/ssl/dummy.key 2048 && \ + openssl req -new -key /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.csr -subj "/C=DE/L=Berlin/O=Vikunja/CN=Vikunja Snakeoil" && \ + openssl x509 -req -days 3650 -in /etc/nginx/ssl/dummy.csr -signkey /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.crt + ADD nginx.conf /etc/nginx/nginx.conf -COPY dist /usr/share/nginx/html -RUN rm /usr/share/nginx/html/js/*.map \ No newline at end of file + +COPY dist /usr/share/nginx/html \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 7208204b27..cba606a311 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,8 +37,14 @@ http { gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml; server { - listen 80; - server_name localhost; + listen 80; + listen 81 default_server http2 proxy_protocol; ## Needed when behind HAProxy with SSL termination + HTTP/2 support + listen 443 default_server ssl http2; + + server_name _; + + ssl_certificate /etc/nginx/ssl/dummy.crt; + ssl_certificate_key /etc/nginx/ssl/dummy.key; location / { root /usr/share/nginx/html;