joomla采用nginx 404的解决方法

joomla使用nginx只能打开首页,其他404。

解决:修改nginx vhost 中的config

server 
    {
        listen 80;
        server_name www.XXX.com;
        root /home/wwwroot/www.XXX.com;
        index index.php;
 
        # Support Clean (aka Search Engine Friendly) URLs
        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }
 
        index index.php index.html index.htm default.html default.htm;
        # deny running scripts inside writable directories
        location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                return 403;
                error_page 403 /403_error.html;
        }
 
        location ~ .*\.(php|php5)?$
            {
                fastcgi_pass unix:/tmp/php-cgi.sock;
                fastcgi_index index.php;
                include fcgi.conf;
            }
 
        # caching of files 
        location ~* \.(ico|pdf|flv)$ {
                expires 1y;
        }
 
        location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                expires 14d;
        }
 
        log_format www.XXX.com '$remote_addr - $remote_user [$time_local] $request '
             '$status $body_bytes_sent $http_referer '
             '$http_user_agent $http_x_forwarded_for';
        access_log /home/wwwlogs/www.XXX.com.log www.XXX.com;
    }

 

 参考http://www.joomlagate.com/forum/topic-46226/

http://docs.joomla.org/Nginx

posted @ 2012-09-26 16:19  范范123  阅读(661)  评论(0编辑  收藏  举报