mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-09-30 13:57:45 -05:00
Use bind mounts for nginx config
This commit is contained in:
@@ -31,10 +31,17 @@ services:
|
||||
command: -conf /etc/coredns/Corefile
|
||||
|
||||
nginx:
|
||||
build: ./nginx
|
||||
image: nginx:mainline-alpine
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./config/nginx.conf
|
||||
target: /etc/nginx/nginx.conf
|
||||
- type: bind
|
||||
source: ./config/nginx
|
||||
target: /etc/nginx/conf.d/
|
||||
dns: 172.20.0.2
|
||||
networks:
|
||||
default:
|
||||
|
||||
30
config/nginx.conf
Normal file
30
config/nginx.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
resolver 127.0.0.11 valid=600s;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
12
config/nginx/account.conf
Normal file
12
config/nginx/account.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name account.pretendo.cc c.account.pretendo.cc conntest.pretendo.cc
|
||||
nasc.pretendo.cc datastore.pretendo.cc api.pretendo.cc assets.pretendo.cc;
|
||||
|
||||
# This prevents nginx from exiting on startup if it can't resolve the upstream
|
||||
set $upstream http://account:8080;
|
||||
location / {
|
||||
proxy_pass $upstream;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
7
config/nginx/default.conf
Normal file
7
config/nginx/default.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user