- Posted
- Filed under 01010101
1. nginx 설정
2. php-fpm 설정
3. nginx, php-fpm 상태 확인하기
1. nginx 설정
[CODE]server {root /usr/share/nginx/www;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
auth_basic "Restricted Access";
auth_basic_user_file /usr/share/nginx/www/.htpasswd;
location / {
try_files $uri $uri/ /index.html;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location = /status {
fastcgi_param SCRIPT_FILENAME /status;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
location /nginx_status {
stub_status on;
allow all;
deny all;
}
}[/CODE]
2. php-fpm 설정
[CODE]$ vi /etc/php5/fpm/pool.d/www.confpm.status_path = /status ; <- 주석 제거[/CODE]
3. nginx, php-fpm 상태 확인하기
브라우저에서 각각http://domain.com/nginx_status
http://domain.com/status
으로 확인합니다.