php nginx ci 部署nginx.conf

user  root;
worker_processes  8;

#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;

    client_max_body_size    1000m;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip on;
    gzip_min_length  1k;
    gzip_buffers     4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 6;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/javascript;
    gzip_vary on;
    gzip_proxied        expired no-cache no-store private auth;
#gzip_disable        "MSIE [1-6]\.";
    server {
      listen       80;
      server_name  localhost;
      root   /usr/local/nginx/html/jordan;
      index  index.html index.htm index.php index.shtml;
      location / {
      #rewrite ^/$ /index.php last;
      rewrite ^/(?!index\.php|robots\.txt|uploadedImages|resource|images|css|styles|js|static)(.*)$ /index.php/$1 last;
      }
          
      location ~ \.js$ {
         expires 1d;
         root /usr/local/nginx/html/jordan;
      }
      location ~* \.(gif|jpg|jpeg)$ {
         expires 1d;
         root   /usr/local/nginx/html/jordan;
      }

# redirect server error pages to the static page /50x.html
#
      error_page   500 502 503 504  /50x.html;

      location = /50x.html {
        root   html;
      }

      location ~ ^(.+\.php)(.*)$ 
      {
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param        SCRIPT_FILENAME        $document_root$fastcgi_script_name;
        fastcgi_param        PATH_INFO                $fastcgi_path_info;
        fastcgi_param        PATH_TRANSLATED        $document_root$fastcgi_path_info;
        include        fastcgi_params;
        include        fastcgi.conf;
      }

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
      #location ~ \.php$ {
      #  root   /usr/local/nginx/html/ci;
      #  fastcgi_pass   127.0.0.1:9000;
      #  fastcgi_index  index.php;
      #  fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
      #  include        fastcgi_params;
      #  include        fastcgi.conf; 
      #}


    }


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
#server {
#    listen       443;
#    server_name  localhost;

#    ssl                  on;
#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_timeout  5m;

#    ssl_protocols  SSLv2 SSLv3 TLSv1;
#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers   on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

你可能感兴趣的:(nginx)