Commit 0b4075b1 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

start setting up nginx

parent 1fb805c5
Pipeline #12671 passed with stage
in 1 minute and 2 seconds
......@@ -14,6 +14,8 @@ services:
depends_on:
- db
command: /code/scripts/start.sh
networks:
- main
db:
container_name: db
......@@ -39,6 +41,18 @@ services:
environment:
- NODE_ENV=development
nginx:
image: nginx:alpine
ports:
- "80:80"
depends_on:
- backend
volumes:
- ./nginx/dev.conf:/etc/nginx/nginx.conf:ro
networks:
- main
volumes:
db-data:
......
user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
client_max_body_size 100m;
upstream backend {
server backend:8000;
}
upstream frontend {
server frontend:8080;
}
server {
listen 80;
charset utf-8;
# frontend urls
location / {
proxy_redirect off;
proxy_pass http://frontend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# frontend dev-server
location /sockjs-node {
proxy_redirect off;
proxy_pass http://frontend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# backend urls
location ~ ^/(admin|api|static) {
proxy_redirect off;
proxy_pass http://backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment