-
-
Save yangvipguang/69292303f337b5054ad93a0ca396fb49 to your computer and use it in GitHub Desktop.
Ngnix conf that contains /check url that can go dark if file exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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