Skip to content

Instantly share code, notes, and snippets.

@u2
Created March 6, 2014 10:42
Show Gist options
  • Select an option

  • Save u2/9387168 to your computer and use it in GitHub Desktop.

Select an option

Save u2/9387168 to your computer and use it in GitHub Desktop.
nagios3 + nginx
server {
listen 80;
server_name xxxxxxxxxxx;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log info;
expires 31d;
root /usr/share/nagios3/htdocs;
index index.php index.html;
auth_basic "Nagios Restricted Access";
auth_basic_user_file /etc/nagios3/htpasswd.users;
location ~ \.cgi$ {
root /usr/lib/cgi-bin/nagios3;
rewrite ^/cgi-bin/nagios3/(.*)$ /$1;
include /etc/nginx/fastcgi_params;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name;
fastcgi_pass fcgiwrap;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass php;
}
location /stylesheets {
alias /etc/nagios3/stylesheets;
}
location /nagios3/stylesheets {
alias /etc/nagios3/stylesheets;
}
location /nagios3/images {
alias /usr/share/nagios3/htdocs/images;
}
}
I have Ubuntu 11.10 and installed php5-fpm and I want to configure nginx. I want to use unix sockets instead of tcp sockets but I couldn't find the
/var/run/php5-fpm.sock
In the default configuration before 12.10 Quantal, PHP FPM is set to listen on TCP port 9000 on address 127.0.0.1. This can be changed in /etc/php5/fpm/pool.d/www.conf.
Look for the line listen = 127.0.0.1:9000 and change it to something like listen = /var/run/php5-fpm.sock. After doing so, restart PHP FPM:
sudo /etc/init.d/php5-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment