From 70a9944f6a07721aee5c95c9607c2a826e5c85a2 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 24 Jun 2024 19:56:45 +0100 Subject: [PATCH] refactor: Update Nginx configuration to enable HTTP/2 This commit updates the Nginx configuration file to enable HTTP/2 by removing the `http2` directive from the `listen` directive and adding a separate `http2` directive. This change ensures that the server supports the latest HTTP/2 protocol, improving performance and security. --- Nginx/default.conf.template | 11 +++++++---- config.example.env | 1 + docker-compose.base.yml | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Nginx/default.conf.template b/Nginx/default.conf.template index 922326b46b..7bc0b2371f 100644 --- a/Nginx/default.conf.template +++ b/Nginx/default.conf.template @@ -43,7 +43,8 @@ server { gzip_proxied no-cache no-store private expired auth; gzip_min_length 1000; - listen 7849 http2; + listen 7849; + http2 on; server_name oneuptime-opentelemetry-collector ${OTEL_COLLECTOR_HOST}; @@ -85,7 +86,8 @@ server { gzip_proxied no-cache no-store private expired auth; gzip_min_length 1000; - listen 7849 http2; + listen 7849; + http2 on; server_name oneuptime-fluentd-collector ${FLUENTD_HOST}; @@ -353,9 +355,10 @@ server { gzip_proxied no-cache no-store private expired auth; gzip_min_length 1000; - listen 7849 http2; + listen 7849; + http2 on; - server_name localhost ingress ${HOST}; #All domains + server_name localhost ingress ${HOST}:${ONEUPTIME_HTTP_PORT}; #All domains proxy_busy_buffers_size 512k; proxy_buffers 4 512k; diff --git a/config.example.env b/config.example.env index e94dc2b144..89dbf1260d 100644 --- a/config.example.env +++ b/config.example.env @@ -31,6 +31,7 @@ INTERNAL_SMTP_PASSWORD=please-change-this-to-random-value # If you are connecting Status Pages to custom domains, then this will be the port where the status page will be hosted on. +# This should be https port because oneuptime automatically generates ssl certs from lets encrypt. STATUS_PAGE_HTTPS_PORT=443 diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 2749ff4201..28cde554df 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -383,6 +383,7 @@ services: - oneuptime environment: <<: *common-server-variables + ONEUPTIME_HTTP_PORT: ${ONEUPTIME_HTTP_PORT} ports: - '${ONEUPTIME_HTTP_PORT}:7849' - '${STATUS_PAGE_HTTPS_PORT}:7850'