<div dir="ltr">Hopefully, someone has had to do what I'm having trouble doing.  We just moved to nginx and php5-fpm for our joomla site.  I've had little nginx experience, so I'm learning on the fly.  I've got a problem I can't quite figure out how to get working with nginx.  <div><br></div><div>We run a SSL only site, so I've got SSL configured and running fine.  The problem is, I want to monitor the server status  with the Percona cacti monitoring templates.  This lets cacti ssh into the server and query localhost/server-status for the data and then pulls that to my cacti installation.  </div><div><br></div><div>The problem is that I can't get the configuration right to let localhost resolve to HTTP and not redirect to HTTPS.  Here's my site config:</div><div><br></div><div>



<div>
<span style="font-family:monospace"><span style="color:rgb(0,0,0)">server {
</span><br>       listen         80;
<br>       server_name    spock;
<br>       return         301 https://$server_name$request_uri;
<br>}
<br><br>
</span>



<div>
<span style="font-family:monospace"><span style="color:rgb(0,0,0)">server {
</span><br>        listen 443 default_server ssl;
<br>        server_name     _;
<br>       .....{SSL and rest of config}</span></div><div><span style="font-family:monospace"><br>server {
<br>        <span style="color:rgb(24,24,178)">#listen 80 default_server;</span><span style="color:rgb(0,0,0)">
</span><br>        listen 443;
<br>        <span style="color:rgb(24,24,178)">#listen [::]:443 default_server ipv6only=on;</span><span style="color:rgb(0,0,0)">
</span><br>
<br>        root /var/www;
<br>        index index.php index.html index.htm;<br>
<br></span></div></div><div>}</div><div><br></div><div>The problem is, if I try  to setup the basic server-status configuration: (Commented out on purpose)</div><div>



<div>
<span style="font-family:monospace"><span style="color:rgb(24,24,178)">#server {</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#       listen          80;</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#       server_name     localhost;</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#               location /server-status {</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#                stub_status on;</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#                allow 127.0.0.1;</span><span style="color:rgb(0,0,0)">
</span><br>                <span style="color:rgb(24,24,178)"># deny all;</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(24,24,178)">#        }</span><br><span style="color:rgb(0,0,0)">
</span><br></span></div></div><div>the return 301 redirect redirects to <a href="https://spock">https://spock</a> and fails to get me to the server-status page.  </div><div><br></div><div>I'm kind of lost on how to make this work.  I just want the status page available to localhost only and via HTTP.  So far, I'm impressed with nginx, but this one has me stumped.  </div><div><br></div><div>Ideas?</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><p><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)">Mark Haney
::: Senior Systems Engineer</span><span style="font-size:10pt;color:black"></span></p><b><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)">VIF</span></b><span><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)"> </span><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)">International Education</span></span><br><span style="color:rgb(51,51,51);font-family:Arial;font-size:10pt">P.O. Box 3566 ::: Chapel Hill, N.C.
27515 ::: USA</span><div><span style="font-size:10pt"><a><span style="font-family:Arial;color:rgb(17,85,204)">919-265-5006</span></a></span><span><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)"> </span></span><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51)">office</span></div><div><span style="color:rgb(51,51,51);font-family:Arial;font-size:10pt"><br></span><span style="color:rgb(51,51,51);font-family:Arial;font-size:10pt;background-color:white">Global learning
for all.</span><br><a href="http://www.vifprogram.com/?utm_source=signature&utm_medium=email&utm_campaign=VIF" style="font-family:Arial;font-size:10pt" target="_blank">www.vifprogram.com</a><div><span style="font-size:10pt;font-family:Arial;background:white">Find VIF on<span> </span></span><span style="font-size:10pt;font-family:Arial"><a href="http://facebook.com/VIFInternationalEducation" target="_blank"><span style="color:rgb(17,85,204);background:white">Facebook</span></a></span><span><span style="font-size:10pt;font-family:Arial;color:rgb(34,34,34);background:white"> </span></span><span style="font-size:10pt;font-family:Arial;color:rgb(34,34,34);background:white">|<span> </span></span><span style="font-size:10pt;font-family:Arial"><a href="http://twitter.com/vifprogram" target="_blank"><span style="color:rgb(17,85,204);background:white">Twitter</span></a></span><span><span style="font-size:10pt;font-family:Arial;color:rgb(17,85,204);background:white"> </span></span><span style="font-size:10pt;font-family:Arial;background:white">|<span> </span></span><span style="font-size:10pt;font-family:Arial"><span style="color:rgb(17,85,204);background:white"><a href="http://www.linkedin.com/company/vif-international-education" target="_blank">LinkedIn</a></span></span><p><span style="font-size:10pt;font-family:Arial;color:black">
Recognized as a<span> </span><a href="http://bestfortheworld.bcorporation.net/" target="_blank"><span style="color:rgb(17,85,204)">‘Best
for the World’</span></a><span> </span>B Corp!</span><span style="font-size:10pt;color:black"></span></p>
</div></div></div></div></div>
</div></div>