Issue when setting up stub_status
ilanbiala opened this issue · 10 comments
I set up stub status (https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-guide.md#configuring-nginx-for-amplify-metric-collection) and at the end ran curl http://localhost/nginx_status and I got:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
have you tried curl https://localhost/nginx_status
That provides a different message:
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
@ilanbiala I think you should try curl http://localhost/nginx_status/
Try to run curl with -v: curl -v http://localhost/nginx_status
You will see response headers. One of them will contain the alternate url.
curl http://localhost/nginx_status/ is the same result as curl http://localhost/nginx_status above.
curl -v http://localhost/nginx_status returns this:
* Hostname was NOT found in DNS cache
* Trying ::1...
* Connected to localhost (::1) port 80 (#0)
> GET /nginx_status HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Date: Fri, 15 Jul 2016 16:04:06 GMT
< Content-Type: text/html
< Content-Length: 193
< Connection: keep-alive
< Location: https://ilanbiala.tk/nginx_status
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
* Connection #0 to host localhost left intact
And doing curl https://ilanbiala.tk/nginx_status returns the same SSL error as above. I'm using Lets Encrypt as my SSL, and when I opened Chrome, it says the certificate is valid.
I fixed the SSL validation error above by switching to using the chain certificate with Nginx, but now when I do curl https://localhost/nginx_status I get:
curl: (51) SSL: no alternative certificate subject name matches target host name 'localhost'
When I do curl https://ilanbiala.tk/nginx_status I get the correct page from Nginx. So is there still an issue?
@ilanbiala
Try to run curl http://localhost/nginx_status
If it works then the agent will be ok.
Anyway, we created a support ticket for further discussion, check your inbox.
curl http://localhost/nginx_status returns
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
I try to use, and I got problem.
curl http://creation-beta.urad.com.tw/nginx_status
Active connections: 1
server accepts handled requests
1 1 1
Reading: 0 Writing: 1 Waiting: 0
curl http://localhost/nginx_status
Active connections: 1
server accepts handled requests
1 1 1
Reading: 0 Writing: 1 Waiting: 0
I think stub_status is work. But when I install amplify-agent I got this error.
13. Checking if stub_status is configured ... no stub_status in nginx config, please check https://git.io/vKTpJ
@ilanbiala Go to nginx amplify support they helped me in no time to setup the stub.
Yep, they helped me out.
