Created
September 2, 2017 12:06
-
-
Save candale/e81f87cc670f2912e72e6b9df37bbd82 to your computer and use it in GitHub Desktop.
Multiple Netdata from same nginx
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
upstream local { | |
server localhost:19999; | |
keepalive 64; | |
} | |
upstream some_other { | |
server some_other:19999; | |
keepalive: 64; | |
} | |
server { | |
# nginx listens to this | |
listen 80; | |
# the virtual host name of this | |
server_name status.your_server.com; | |
location = { | |
return 301 /default_app; | |
} | |
location = / { | |
return 301 /default_app; | |
} | |
location ~ /(?<behost>.*)/(?<ndpath>.*) { | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_http_version 1.1; | |
proxy_pass_request_headers on; | |
proxy_set_header Connection "keep-alive"; | |
proxy_store off; | |
proxy_pass http://$behost/$ndpath$is_args$args; | |
gzip on; | |
gzip_proxied any; | |
gzip_types *; | |
auth_basic "Restricted Content"; | |
auth_basic_user_file /etc/nginx/.netdata_htpasswd; | |
} | |
location ~ /(?<behost>.*) { | |
return 301 /$behost/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment