Add nginx routing

This commit is contained in:
Maksym Pavlenko
2019-05-30 12:57:07 -07:00
parent 11932bbce2
commit c9b6f7e7b0
4 changed files with 37 additions and 4 deletions
+1
View File
@@ -1,2 +1,3 @@
node_modules/
vendor/
bin/
+1
View File
@@ -13,3 +13,4 @@ COPY cmd/nginx/podsync.conf /etc/nginx/nginx.conf
COPY cmd/nginx/robots.txt /var/www/podsync/
COPY --from=builder /app/dist/html/ /var/www/podsync/
COPY --from=builder /app/dist/assets/ /var/www/podsync/assets/
COPY /assets/favicon.ico /var/www/podsync/
+32 -1
View File
@@ -19,6 +19,17 @@ http {
gzip_min_length 1000;
gzip_proxied any;
upstream api {
server api:5001;
}
upstream resolver {
server resolver:8080;
}
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
server {
server_name _;
listen 80;
@@ -31,8 +42,28 @@ http {
return 200 "pong\n";
}
location /download {
proxy_read_timeout 180s;
proxy_pass http://resolver;
}
location = /api/webhooks {
proxy_pass http://api;
client_max_body_size 128k;
}
location ~ (/user|/api) {
proxy_pass http://api;
}
location / {
try_files $uri $uri.html $uri/ =404;
try_files $uri $uri.html $uri/ @api;
}
location @api {
proxy_pass http://api;
proxy_buffers 8 16k;
proxy_buffer_size 16k;
}
}
}
+3 -3
View File
@@ -6,7 +6,7 @@ services:
container_name: api
restart: always
ports:
- 8080:5001
- 5001
environment:
- REDIS_CONNECTION_URL=redis://redis
- POSTGRES_CONNECTION_URL={POSTGRES_CONNECTION_URL}
@@ -37,14 +37,14 @@ services:
container_name: nginx
restart: always
ports:
- 8081:80
- 80:80
resolver:
image: mxpv/resolver:latest
container_name: resolver
command: --workers 8
restart: always
ports:
- 8082:8080
- 8080
environment:
- AWS_DEFAULT_REGION=us-east-1
- DYNAMO_FEEDS_TABLE_NAME=Prod_Feeds