首页 文章

Nginx Wave Framework API配置问题 - 警告:不支持Nginx HttpRewriteModule

提问于
浏览
1

我已经搜索了几天,并通过反复试验尝试了各种配置,但我无法纠正我的配置 . 我的专长是数据库设计和开发,因此服务器配置一直充满挑战 .

我在LEMP堆栈上安装了Wave Framework . Wave是一个PHP微框架,它遵循模型 - 视图 - 控制架构和工厂方法设计模式松散地构建http://www.waveframework.com/wave/doc/index.htm

令人惊讶的是,它很容易上你的服务器,但我无法解决一个问题 . 在我的服务器上,我在线路中添加了Wave建议的nginx配置文件,我仍然收到警告“警告:不支持Nginx HttpRewriteModule,索引网关和重写功能不起作用,如果索引网关不是,则可以忽略此警告用过的”

除此之外,我已经能够使用Wave Framework的许多功能,并获得了我的模型和控制器的一部分编码 .

请帮忙,我的配置粘贴在下面 .

nginx.conf

用户www-data; worker_processes 4; pid /run/nginx.pid; events {worker_connections 768; } http {sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; rewrite_log on;包括/etc/nginx/mime.types; default_type application / octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable“msie6”; include /etc/nginx/conf.d/*.conf;包括/ etc / nginx / sites-enabled / *; }

/ etc / nginx / sites-enabled / default(我更改了我的域名)

server {listen 80; root / usr / share / nginx / www;

index index.php;

server_name * .example.com;
#这是为了确保/ resources / static /文件夹中的文件不会被PHP位置解析^〜/ resources / static / {break;
} error_page 404 /404.html; error_page 500 502 503 504 /50x.html;

location = /50x.html {

root / usr / share / nginx / www;

}
#重写指向除PHP之外的所有内容到索引文件#确保将其放在服务器配置的“location~.php $ {”之前 . location / {rewrite ^( . *)$ . / index.php last;
#将php脚本传递给php引擎位置〜\ .php $ {

try_files $ uri = 404;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;

包括fastcgi_params;
}}

http://www.example.com/tools/compatibility.php(我的域名输出 - wave框架)

成功:PHP是5.3.0或更高版本(运行5.5.9-1ubuntu4.3)成功:PHP设置short_open_tag已启用成功:支持PDO成功:支持PDO MySQL ...警告:不支持Mcrypt PHP扩展,这是可选的,仅在使用www-crypt-input和www-crypt-output请求进行API请求时使用SUCCESS:支持Zip成功:支持FTP警告:不支持Memcache,如果不支持,可以忽略打算支持Memcache作为缓存层SUCCESS:支持GD图形库SUCCESS:使用Nginx服务器警告:不支持Nginx HttpRewriteModule,索引网关和重写功能不起作用,如果未使用索引网关,则可以忽略此警告SUCCESS :/ filesystem /是可写的成功:/ filesystem / cache /是可写的......成功:/ filesystem / data /是可写的

我并不担心HttpRewriteModule之外的其他警告提前谢谢!

1 回答

  • 0

    所以我(帮助)回答了我自己的问题 . 任何使用Nginx尝试使用Wave Framework的人都会遇到这种情况(至少有3.7.1当前版本) . Wave Framework有一个Nginx HTTPrewriteModule的错误,你提供的配置文件实现到你的Nginx配置是错误的 . 下面是我的etc / nginx / sites-enabled / default配置文件 .

    # this file is /etc/nginx/sites-enabled/default
    
    server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    
        access_log /var/log/nginx/default/access.log;
        error_log /var/log/nginx/default/error.log;
    
    root /var/www/default;
    index index.php index.html index.htm;
    
        # domain names of this vhost (important if there are more
        # than one vhost on the same IP:PORT combination)
    server_name localhost mydomain.com alias.mydomain.com;
    
        # deny access to .htaccess files
        location ~ /\.ht {
                deny all;
        }
    
        # deny access to hidden files, that is the ones which names that start
        # with . (dot)
        location ~ /\. {
                deny all;
        }
    
        # This is for making sure that files in /resources/static/ folder don't get parsed    with PHP
        location ^~ /resources/static/ {
                break;
        }
    
        # Uncomment to satisfy compatibility check for Nginx rewrite module
    # (based on .htaccess delivered with Wave Framework)
    #   location ~ compatibility\.php$ {
    #       if ($query_string != rewrite_enabled) {
    #           rewrite ^(.*)$ $1?rewrite_enabled break;
    #       }
    #       fastcgi_pass unix:/var/run/php5-fpm.sock;
    #       fastcgi_index index.php;
    #       include fastcgi_params;
    #   }
    
    location / {
        rewrite ^(.*)$ /index.php last;
    }
    
        # Uncomment if you have a custom 404 page
    #error_page 404 /404.html;
    
    # redirect server error pages to the static page /50x.html
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
    
    # pass the PHP scripts to FastCGI server
    location ~ \.php$ {
    #   fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
    }
    

相关问题