-
Notifications
You must be signed in to change notification settings - Fork 56
Add status endpoint #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add status endpoint #333
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,12 @@ http { | |
return 200; | ||
} | ||
|
||
{{ if $routerConfig.statusEndpoint }} | ||
location /nginx_status { | ||
stub_status on; | ||
} | ||
{{ end }} | ||
|
||
location / { | ||
proxy_buffering {{ if $routerConfig.ProxyBuffersConfig.Enabled }}on{{ else }}off{{ end }}; | ||
proxy_buffer_size {{ $routerConfig.ProxyBuffersConfig.Size }}; | ||
|
@@ -186,6 +192,11 @@ http { | |
location / { | ||
return 404; | ||
} | ||
{{ if $routerConfig.statusEndpoint }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you groomed the commits and force-pushed... I think you lost the model changes that complement this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Damn indeed. :) That's stupid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would consider moving this section up between the health check and the |
||
location /nginx_status { | ||
stub_status on; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still want this to be conditional though, yes? Also, should this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll read up on whitelisting in the router, pushed a single commit for the configurability |
||
{{ end }} | ||
} | ||
{{ end }} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the leading whitespace be made consistent with what's above and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, just a quick question, are you fine with just restricting /nginx_status to 127.0.0.1 for now and deny all? the use case primarily being monitoring this should be fine
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We've already done that very same thing here: https://github.com/deis/router/blob/master/nginx/config.go#L202-L207
This makes me wonder a few things.
127.0.0.1:9090/stats
something you can work with? i.e. Is this new endpoint needed for something you can't already get?127.0.0.1:9090/nginx_status
a better place for this? I ask because the whole purpose of that server block listening on 9090 is to have a block that's guaranteed to never be using PROXY protocol. Anything listening for traffic from the outside world (e.g. the default vhost) may very well have that enabled-- which means it wouldn't be able to handle traffic coming at it from somewhere other than a proxy / LB that also has that enabled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1, yes I'm aware, we're using mainly sysdig and the grafana part we skipped from our setup
2, sysdig wants me to have the nginx stub status exposed
3, sysdig cloud for the containers and newrelic for api performance metrics
4, 127.0.0.1:9090/nginx_status works just fine for me! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Awesome. Let's start there. If, as time goes on, there is some compelling reason to expose this beyond that, we can take it up then.