Url的重写
nginx的配置文件
[root@localhost protected]# vim /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location ~ /(protected|framework|nbproject|themes/\w+/views|

本文详细介绍了如何在Nginx服务器上进行Yii框架的部署,包括Nginx的配置文件设置,Yii项目的URL重写配置,以及最后如何正确重启Nginx服务以使更改生效。
订阅专栏 解锁全文
1901

被折叠的 条评论
为什么被折叠?



