# This default error log path is compiled-in to make sure configuration parsing
# errors are logged somewhere, especially during unattended boot when stderr
# isn't normally logged anywhere. This path will be touched on every nginx
# start regardless of error log location configured here. See
# https://trac.nginx.org/nginx/ticket/147 for more info.
#error_log /var/log/nginx/error.log;
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;
#access_log logs/host.access.log main;
root /usr/local/www/nginx;
index index.html index.htm index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
if (!-f $request_filename){
rewrite (.*) /index.php;}
location ~ .*.php(/.*)*$ {
root /usr/local/www/nginx;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $request_filename;
#location ~ .*.php(/.*)*$ {
# include fastcgi_params;
# fastcgi_pass 127.0.0.1:9000;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
root /usr/local/www/nginx-dist;
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
# proxy_pass http://127.0.0.1;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .*.php(/.*)*$ {
root /usr/local/www/nginx;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $request_filename;
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
# another virtual host using mix of IP-, name-, and port-based configuration
# server_name somename alias another.alias;
# index index.html index.htm;
ssl_certificate /usr/local/etc/nginx/fbxs.crt;
ssl_certificate_key /usr/local/etc/nginx/fbxs.key;
ssl_certificate fbxs.crt;
ssl_certificate_key fbxs.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
ssl_prefer_server_ciphers on;
location ~ .*.php(/.*)*$ {
root /usr/local/www/nginx-dist;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $request_filename;
root /usr/local/www/nginx-dist;