[OS X, 맥 OS X] nginx 설정2 - from github : 설정파일 내용

2017-01-16 10:33:00

/usr/local/etc/nginx/nginx.conf

#########################################################################################

worker_processes 1;

error_log /usr/local/etc/nginx/logs/error.log debug;

events {

worker_connections  1024;

}

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  /usr/local/etc/nginx/logs/access.log  main;

  

sendfile            on;

  

keepalive_timeout   65;

  

index index.html index.php;

  

include /usr/local/etc/nginx/sites-enabled/*;

}

#########################################################################################

/usr/local/etc/nginx/conf.d/php-fpm

#########################################################################################

location ~ \.php$ {

try_files      $uri = 404;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

include        fastcgi_params;

}

#########################################################################################

/usr/local/etc/nginx/sites-available/default

#########################################################################################

server {

listen       80;

server_name  localhost;

root       /var/www/;

  

access_log  /usr/local/etc/nginx/logs/default.access.log  main;

  

location / {

    include   /usr/local/etc/nginx/conf.d/php-fpm;

}

  

location = /info {

    allow   127.0.0.1;

    deny    all;

    rewrite (.*) /.info.php;

}

  

error_page  404     /404.html;

error_page  403     /403.html;

}

#########################################################################################

/usr/local/etc/nginx/sites-available/default-ssl

#########################################################################################

server {

listen       443;

server_name  localhost;

root       /var/www/;

  

access_log  /usr/local/etc/nginx/logs/default-ssl.access.log  main;

  

ssl                  on;

ssl_certificate      ssl/localhost.crt;

ssl_certificate_key  ssl/localhost.key;

  

ssl_session_timeout  5m;

  

ssl_protocols  SSLv2 SSLv3 TLSv1;

ssl_ciphers  HIGH:!aNULL:!MD5;

ssl_prefer_server_ciphers   on;

  

location / {

    include   /usr/local/etc/nginx/conf.d/php-fpm;

}

  

location = /info {

    allow   127.0.0.1;

    deny    all;

    rewrite (.*) /.info.php;

}

  

error_page  404     /404.html;

error_page  403     /403.html;

}

#########################################################################################

Comments