发布于 2015-08-09 08:58:08 | 2078 次阅读 | 评论: 0 | 来源: 网络整理
基于php-fpm来运行swoole/framework的MVC程序,这是传统的LAMP模式。
server {
listen 80;
root /home/htf/workspace/php/swoole.com;
index index.php index.html;
server_name local.swoole.com;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php;
}
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
<VirtualHost *:80>
ServerName www.swoole.com
DocumentRoot /data/webroot/www.swoole.com
<Directory "/data/webroot/www.swoole.com">
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,P]
</IfModule>
</VirtualHost>