nginx + php-fpm + zend框架2重写规则?

时间:2014-11-25 09:53:43

标签: zend-framework zend-framework2

  • 我的环境
  • nginx 1.6.4
  • php 5.4
  • zf 2.3

我的nginx vhost配置文件


    server {
        listen 80;
        server_name domain;
        access_log /home/wwwlogs/domain_nginx.log combined;
        index index.html index.htm index.jsp index.php;
        include none.conf;
        root /home/wwwroot/domain;
        #error_page 404 /404.html;
        if ( $query_string ~* ".*[\;'\].*" ){
            return 404;
            }
        location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv)$ {
            if ($invalid_referer) {
                #rewrite ^/ http://www.linuxeye.com/403.html;
                return 403;
                }
            }

        location ~ .*\.(php|php5)?$  {
            #fastcgi_pass remote_php_ip:9000;
            fastcgi_pass unix:/dev/shm/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
            expires 30d;
            }

        location ~ .*\.(js|css)?$ {
            expires 7d;
            }
    }

谁可以帮助我?我无法解决它!

0 个答案:

没有答案