Nginx.conf 配置文件标准配置(删除不必要的注释,更清晰)

来源:互联网 发布:淘宝服装平铺后期教程 编辑:程序博客网 时间:2024/06/08 01:39
#user  nobody;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;}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;    server {        listen       8080;        server_name  localhost;        location / {            root   /usr/local/var/www;            index index.html index.htm;        }        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        location ~ \.php$ {            root           /usr/local/var/www;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }    }    server {            listen       8081;            server_name  develop.nami.com;            location / {                root   /usr/local/var/www/nami;                index  index.php index.html index.htm;            }            location ~ \.php$ {                root           /usr/local/var/www/nami;                fastcgi_pass   127.0.0.1:9000;                index          index.php                fastcgi_index  index.php;                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;                include        fastcgi_params;            }        }    server {        listen 8082;        server_name www.blogsite.com;        root /usr/local/var/www/scenes;        index index.php index.htm index.html;        location / {            try_files $uri $uri/ /index.php;        }        location /index.php{            fastcgi_pass  127.0.0.1:9000;            fastcgi_param SCRIPT_FILENAME /usr/local/var/www/scenes/index.php;            fastcgi_param PATH_INFO $fastcgi_path_info;            fastcgi_split_path_info ^(.+\.php)(.*)$;            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;            include  fastcgi.conf;        }    }    include servers/*;}
原创粉丝点击