Skip to content

Instantly share code, notes, and snippets.

@hoangdh
Last active June 4, 2017 11:18
Show Gist options
  • Save hoangdh/e95423a3a8db4c9ffc1ca253c7cb6f32 to your computer and use it in GitHub Desktop.
Save hoangdh/e95423a3a8db4c9ffc1ca253c7cb6f32 to your computer and use it in GitHub Desktop.
File cấu hình nginx có status.
#user nobody;
worker_processes auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
## Trang thai cua cac stream
stream {
server_traffic_status_zone;
upstream web_lb {
server 192.168.100.142:80;
server 192.168.100.143:80;
}
server {
listen 81;
proxy_pass web_lb;
}
}
http {
include mime.types;
default_type application/octet-stream;
## Trang thai cua cac VHOST
stream_server_traffic_status_zone;
vhost_traffic_status_zone;
geoip_country /usr/share/GeoIP/GeoIP.dat;
vhost_traffic_status_filter_by_set_key $geoip_country_code country::*;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8080;
server_name status-nginx.com;
location / {
return 301 /status-stream;
}
## Prefix cua trang xem trang thai
location /status-stream {
stream_server_traffic_status_display;
stream_server_traffic_status_display_format html;
}
vhost_traffic_status_filter_by_set_key $geoip_country_code country::$server_name;
location /status-web {
vhost_traffic_status_display;
vhost_traffic_status_display_format html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /status-native {
stub_status on;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment