bitfeed/client/nginx/bitfeed.conf.template

50 lines
1.4 KiB
Plaintext

map $sent_http_content_type $expires {
default off;
text/css max;
application/javascript max;
}
proxy_cache_path /var/cache/nginx/bitfeed levels=1:2 keys_zone=bitfeed:10m max_size=500m inactive=1w use_temp_path=off;
server {
listen 80;
root /var/www/bitfeed;
index index.html;
server_name client;
location = / {
add_header Cache-Control 'no-cache';
}
location / {
try_files $uri $uri/ =404;
expires $expires;
}
location /api {
proxy_cache bitfeed;
proxy_cache_revalidate on;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_pass http://wsmonobackend;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
location /ws/txs {
proxy_pass http://wsmonobackend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
upstream wsmonobackend {
server ${BACKEND_HOST}:${BACKEND_PORT};
}