apache server-status behind nginx

If you cannot access /server-status page on apache which is behind nginx

1. check if elinks are installed
  • rpm -aq|grep elinks
    elinks-0.12-0.6.pre2.fc10.i386
    (Checks if elinks is installed.  Do this before installing elinks.)
  • yum install elinks
    (IF elinks is NOT installed)
  • rpm -aq|grep elinks
    elinks-0.12-0.6.pre2.fc10.i386
    (To verify installation worked) 
2. Check if status is enabled in httpd.conf
  • vi /etc/httpd/conf/httpd.conf
  • Find and uncomment the line ExtendedStatus On (Remove # from start of line)
  • Find and uncomment the following directives.  Change configuration From #<Location /server-status>
    #   SetHandler server-status
    #    Order deny,allow
    #    Deny from all
    #    Allow from example.com
    #</Location>
    To <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from localhost 127.0.0.1
    </Location>
  • Save the configuration file and exit (In vi type :wq )
  • service httpd restart
    (Restart the httpd service) 
 If still cannot access add to nginx/conf.d/default.conf

location /server-status/ {
           fastcgi_pass 127.0.0.1:9000 #if using php-fpm
           proxy_pass http://127.0.0.1:8080 #to your local listening apache on port 8080 or other
}

3. restart nginx

4. if still does not work - check if you use virtual host on apache, if yes move your block  

<Location /server-status> inside <VirtualHost *:8080> 

and restart apache

5. check if you can access

lynx -dump http://127.0.0.1:8080/server-status


6. if still does not work check if there is no redirection problem in .htaccess file and add

RewriteCond %{REQUEST_URI} !=/server-status



 



Comments

Popular posts from this blog

How to clean DB from old logs in Magento 1.x

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

Apache 2.4 + mod_wsgi + Python 3.7 + Django installation on Centos 7.10