2020-07-22 17:14:49 -04:00

48 lines
1.2 KiB
Nginx Configuration File

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;
text/css 1M;
application/javascript 1M;
application/x-font-woff 3M;
~image/ 6M;
}
server {
listen 80 default_server;
server_name _;
expires $expires;
location / {
proxy_pass http://bb:8080/;
proxy_cache STATIC;
proxy_cache_valid 200 5s;
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
}
}
}