From 78289f19fe8a4c4726ba78515ec21eb8ea41f17b Mon Sep 17 00:00:00 2001 From: Francesco Frassinelli Date: Fri, 9 Feb 2024 14:35:12 +0100 Subject: [PATCH] Fix nginx conf --- docker-compose.yml | 3 ++- nginx/default.conf.template | 11 ++++------- nginx/dev.conf.template | 19 ------------------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 02c04b8..691c346 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,8 @@ services: image: nginx volumes: - ./data:/var/www/data:ro - - ./nginx/dev.conf.template:/etc/nginx/templates/default.conf.template:ro + - ./nginx/default.conf.template:/etc/nginx/templates/default.conf.template:ro + - ./nginx/dev.conf.template:/etc/nginx/templates/dev.conf.template:ro vite: build: diff --git a/nginx/default.conf.template b/nginx/default.conf.template index daa70d4..7d245a2 100644 --- a/nginx/default.conf.template +++ b/nginx/default.conf.template @@ -1,15 +1,12 @@ -upstream titiler { - server titiler:8080; - keepalive 64; -} - server { listen 80; server_name localhost; - root /var/www; + + resolver 127.0.0.11 ipv6=off; location /tiler/ { - proxy_pass http://titiler; + set $titiler titiler:8080; + proxy_pass http://$titiler; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; diff --git a/nginx/dev.conf.template b/nginx/dev.conf.template index 73d0775..cb24b00 100644 --- a/nginx/dev.conf.template +++ b/nginx/dev.conf.template @@ -1,11 +1,5 @@ -upstream titiler { - server titiler:8080; - keepalive 64; -} - server { listen 80; - server_name localhost; root /var/www; absolute_redirect off; @@ -13,14 +7,6 @@ server { try_files $uri $uri/; } - location /tiler/ { - proxy_pass http://titiler; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; - } - location / { proxy_pass http://vite:3000; proxy_http_version 1.1; @@ -28,9 +14,4 @@ server { proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } }