nginx编译
wget http://nginx.org/download/nginx-1.9.12.tar.gz
tar zxvf nginx-1.9.12.tar.gz
cd nginx-1.9.12
brew install autoconf pcre proxychains-ng gd openssl memcached
brew install mysql ant python
--with-threads \
--with-openssl=`brew --prefix openssl` \
brew unlink openssl
xcode-select install
./configure --prefix=/usr/local/nginx \
--with-http_realip_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_stub_status_module \
--with-http_degradation_module \
--with-http_secure_link_module \
--with-http_auth_request_module \
--with-stream \
--with-pcre \
--with-pcre-jit \
linux的配置
php mac 编译
brew install autoconf pcre proxychains-ng gd openssl memcached
brew install mysql ant python
./configure --prefix=/usr/local/nginx \
--with-threads \
--with-openssl="/usr/local/Cellar/openssl/1.0.2g/include" \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_stub_status_module \
--with-http_degradation_module \
--with-http_secure_link_module \
--with-http_auth_request_module \
--with-stream \
--with-pcre \
--with-pcre-jit \
kqueue
user root;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
# gzip_disable "msie6";
# gzip_disable "msie6";
# gzip_comp_level 6;
# #gzip_comp_level 9;
# gzip_min_length 1100;
# gzip_buffers 16 8k;
# gzip_proxied any;
# gzip_http_version 1.1;
# gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/$
include vhosts/*.conf;
}
mkdir vhosts
nano wow.conf
server {
listen 80;
server_name wowdsgn.loc;
#root html;
root /data/wow/server/;
index index.html index.htm index.php;
add_header 'Access-Control-Allow-Origin' '*';
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
location ^~ /app/ { deny all; }
location ^~ /includes/ { deny all; }
location ^~ /lib/ { deny all; }
location ^~ /media/downloadable/ { deny all; }
location ^~ /pkginfo/ { deny all; }
location ^~ /report/config.xml { deny all; }
location ^~ /var/ { deny all; }
location /var/export/ { ## Allow admins only to view export folder
auth_basic "Restricted"; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
autoindex on;
}