Skip to content

Commit 96aab52

Browse files
committed
chg: use proxy for accessing titiler
1 parent 5ef9174 commit 96aab52

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
environment:
1212
- TITILER_API_CORS_ORIGINS=*
1313
- TITILER_API_CACHECONTROL=no-cache
14+
- TITILER_API_ROOT_PATH=/titiler
1415
- FORWARDED_ALLOW_IPS=*
1516
- REDIS_HOST=redis
1617
ports:

nginx/default.conf.template

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
upstream titiler_upstream {
2+
server titiler:80;
3+
}
4+
15
server {
26
listen 80;
37
server_name localhost;
@@ -7,6 +11,10 @@ server {
711
try_files $uri /index.html;
812
}
913

14+
location /titiler/ {
15+
proxy_pass http://titiler_upstream;
16+
}
17+
1018
error_page 500 502 503 504 /50x.html;
1119
location = /50x.html {
1220
root /usr/share/nginx/html;

public/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464
},
6565
"config": {
66-
"titiler_api_url": "http://localhost:5173/titiler",
66+
"titiler_api_url": "/titiler",
6767
"theme": "nord",
6868
"language": "no",
6969
"footer": {

vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export default defineConfig({
1111
'/titiler': {
1212
target: 'http://localhost:8989',
1313
changeOrigin: true,
14-
rewrite: path => path.replace(/^\/titiler/, ''),
1514
},
1615
},
1716
},

0 commit comments

Comments
 (0)