zoukankan      html  css  js  c++  java
  • nginx 配置文件配置

    server {
        listen       80 ;
        server_name  test.com www.test.com;
            index index.html index.php index.htm;
            root /alidata/www/test/public/;
    
            if ( $query_string ~* ".*[;'<>].*" ){
                return 404;
            }
    
    
                return 404;
            }
    
    
        location  / {
            try_files $uri $uri/ /index.php?$query_string;
        }
    
        if (!-f $request_filename){
             rewrite ^/(.+)$ /index.php?$1& last;
        }
    
    
            location ~ .*.(php|php5)?$
            {
              if ( $host != 'test.com' ) {
                rewrite ^/(.*)$ http://test.com permanent;
            }
    
                    fastcgi_pass  127.0.0.1:9000;
                    fastcgi_index index.php;
                    include fastcgi.conf;
            }
            location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
            {
                    expires 30d;
            }
            location ~ .*.(js|css)?$
            {
                    expires 1h;
            }
            access_log  /alidata/log/nginx/access/default.log;
    }
    

      

  • 相关阅读:
    PHP-会话控制
    PHP-文件上传
    PHP-文档目录
    PHP-正则表达式
    PHP-数组类型
    PHP-函数编程
    PHP-基础知识
    $_FILES系统函数
    话说 MAX_FILE_SIZE
    Hello~! 我的blog
  • 原文地址:https://www.cnblogs.com/freespider/p/5199271.html
Copyright © 2011-2022 走看看