Hide PHP-FPM Version on NGINX
Posted by blackonsole on August 12th, 2017 02:06 PM | No Comment
Check PHP-FPM version on NGINX HTTP response
$ curl -I localhost/index.php
HTTP/1.1 200 OK
Date: Sat, 12 Aug 2017 14:07:54 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.22
How to hide PHP-FPM Version (X-Powered-By:) on NGINX
vim /etc/php5/fpm/php.ini
expose_php = Off
Restart php5-fpm service
/etc/init.d/php5-fpm restart
Check the result
$ curl -I localhost/index.php
HTTP/1.1 200 ...
Hide Server Info Response on NGINX
Posted by blackonsole on August 12th, 2017 05:00 AM | No Comment
How to hide `Server:` Response info on NGINX
$ curl -I localhost
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Fri, 11 Aug 2017 14:09:04 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 04 Mar 2014 11:46:45 GMT
Connection: keep-alive
ETag: "5315bd25-264"
Accept-Ranges: bytes
To hide `Server:` on HTTP Response, you need install ...
Block or ban ip with NGINX
Posted by blackonsole on December 22nd, 2016 11:47 AM | No Comment
How to block ip with NGINX
0. define block ip on nginx.conf
vim /etc/nginx/nginx.conf
http {
geo $ban_ip {
default 0;
include ban_ip.conf;
}
}
that will blocked ip by clientip on access.log, if want to block ...
Redirect www and non-www http to non-www https on NGINX
Posted by blackonsole on September 3rd, 2016 12:27 PM | No Comment
How to set up redirect www and non-www http to non-www https
o nginx config file
vim /etc/nginx/sites-enabled/blackonsole.conf
# http
server {
listen 80;
server_name blackonsole.org www.blackonsole.org;
return 301 https://blackonsole.org$request_uri;
}
# https
server ...
Fix AWStats on WHM/cPanel with NGINX
Posted by blackonsole on December 12th, 2015 12:06 AM | No Comment
What is AWStats
AWStats is short for Advanced Web Statistics. AWStats is powerful log analyzer which creates advanced web, ftp, mail and streaming server statistics reports based on the rich data contained in server logs. Data is graphically presented in easy to read web pages.
Fix AWStats issue ...
CentOS :: Setting Varnish, Nginx for WordPress
Posted by blackonsole on July 15th, 2013 03:01 AM | 1 Comment
:: How to setting Varnish and Nginx for WordPress cms in Linux CentOS
+ Enable Varnish and Nginx repository
rpm --nosignature -i //repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm
rpm -Uvh //nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
+ Installing Varnish and Nginx
yum install varnish nginx php-fpm
+ Configure Nginx for WordPress
make sure change Nginx port ...
Ubuntu :: PHP FastCGI + NGINX
Posted by blackonsole on February 28th, 2013 06:54 AM | 1 Comment
:: How to setup PHP FastCGI for NGINX in Ubuntu
+ Installing NGINX and php-cgi
apt-get update
apt-get install nginx php5-cli php5-cgi spawn-fcgi
+ Make php-fcgi script in init.d
vi /etc/init.d/php-fcgi
add these line:
#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start() {
...