mirror of
https://github.com/docker-training/node-bulletin-board.git
synced 2025-12-15 07:16:43 +08:00
Add v4, with proxy, app and db
This commit is contained in:
4
bulletin-board-proxy/Dockerfile
Normal file
4
bulletin-board-proxy/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM nginx:1.13.6
|
||||
|
||||
RUN mkdir -p /data/nginx/cache
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
43
bulletin-board-proxy/nginx.conf
Normal file
43
bulletin-board-proxy/nginx.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:30m inactive=24h max_size=200m use_temp_path=off;
|
||||
|
||||
proxy_pass_request_headers on;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Connection keep-alive;
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
|
||||
add_header X-Host $hostname;
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
map $sent_http_content_type $expires {
|
||||
default off;
|
||||
~image/ 6M;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
expires $expires;
|
||||
|
||||
location / {
|
||||
proxy_pass http://bb-app:8080/;
|
||||
proxy_cache STATIC;
|
||||
proxy_cache_valid 200 1h;
|
||||
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user