Skip to content

Commit

Permalink
Fix nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Feb 9, 2024
1 parent 28a019a commit 78289f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 4 additions & 7 deletions nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
19 changes: 0 additions & 19 deletions nginx/dev.conf.template
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
upstream titiler {
server titiler:8080;
keepalive 64;
}

server {
listen 80;
server_name localhost;
root /var/www;
absolute_redirect off;

location ~* ^/data/(.+) {
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;
proxy_set_header Upgrade $http_upgrade;
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;
}
}

0 comments on commit 78289f1

Please sign in to comment.