Skip to content

Commit e063785

Browse files
committed
update nginx docker config
1 parent b1b393c commit e063785

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

docker-compose.nginx.yml

-13
This file was deleted.

docker-compose.yml

+17
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ services:
7676
- database
7777
- app
7878

79+
nginx:
80+
image: nginx
81+
ports:
82+
- ${STAC_FASTAPI_NGINX_PORT:-8080}:80
83+
volumes:
84+
- ./nginx.conf:/etc/nginx/nginx.conf
85+
depends_on:
86+
- app-nginx
87+
command: [ "nginx-debug", "-g", "daemon off;" ]
88+
89+
app-nginx:
90+
extends:
91+
service: app
92+
command: bash -c "./scripts/wait-for-it.sh database:5432 && uvicorn stac_fastapi.pgstac.app:app --host 0.0.0.0 --port 8082 --proxy-headers --forwarded-allow-ips=*"
93+
environment:
94+
- ROOT_PATH=/api/v1/pgstac
95+
7996
networks:
8097
default:
8198
name: stac-fastapi-network

nginx.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ http {
66

77
location /api/v1/pgstac {
88
rewrite ^/api/v1/pgstac(.*)$ $1 break;
9-
proxy_pass http://app:8082;
10-
proxy_set_header HOST $host;
9+
proxy_pass http://app-nginx:8082;
10+
proxy_set_header HOST $http_host;
1111
proxy_set_header Referer $http_referer;
1212
proxy_set_header X-Forwarded-For $remote_addr;
1313
proxy_set_header X-Forwarded-Proto $scheme;

0 commit comments

Comments
 (0)