×

maccms nginx

maccms v10在使用nginx做网页服务的时候需要做伪静态,重定向次数过多

我的笔记 我的笔记 发表于2019-02-26 16:43:13 浏览5902 评论0

抢沙发发表评论

问题:

    在k3上搭建好onmp环境后,我的web服务用的是nginx,所以安装好maccms v10需要伪静态配置

解决办法:

    下边的代码就是maccms v10在nginx环境下的伪静态配置,如果不配置会导致重定向次数过多这个错误,只需要把#othercon下面的if语句复制一下就行了

server {
    listen 83;
    server_name localhost;
    root /opt/wwwroot/maccms/;
    index index.html index.htm index.php tz.php;
    include /opt/etc/nginx/conf/php-fpm.conf;
    #othercon
	if (!-e $request_filename) {
            rewrite ^/index.php(.*)$ /index.php?s=$1 last;
            rewrite ^/admin.php(.*)$ /admin.php?s=$1 last;
            rewrite ^(.*)$ /index.php?s=$1 last;
            break;
        }
}


我的笔记博客版权我的笔记博客版权