Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Created September 14, 2016 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save patmandenver/8533bb3ff06e545cdb391dab3f40e161 to your computer and use it in GitHub Desktop.
Save patmandenver/8533bb3ff06e545cdb391dab3f40e161 to your computer and use it in GitHub Desktop.
Ngnix conf that contains /check url that can go dark if file exists
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
index index.html index.htm;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_names_hash_bucket_size 128;
keepalive_timeout 70;
types_hash_max_size 2048;
gzip on;
gzip_disable "msie6";
log_format main_fmt '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
access_log /var/log/nginx/access.log main_fmt;
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /check {
if (-f /tmp/check) {
return 404;
}
add_header Content-Type text/plain;
return 200 "UP";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment