add nginx.conf
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:latest
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: dockerfiles/nginx/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
|
||||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- etherpad
|
- etherpad
|
||||||
|
|||||||
2
dockerfiles/nginx/Dockerfile
Normal file
2
dockerfiles/nginx/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
COPY dockerfiles/nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
26
dockerfiles/nginx/nginx.conf
Normal file
26
dockerfiles/nginx/nginx.conf
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
##########################
|
||||||
|
# Proxy API requests to the back service
|
||||||
|
##########################
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://back:8080/api/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
}
|
||||||
|
##########################
|
||||||
|
# FrontEnd returns
|
||||||
|
##########################
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user