开发者社区> 问答> 正文

有朋友对joomla比较熟悉吗

joomla版本3.5
服务器环境:nginx1.8+php7


[font="]nginx下伪静态一直不成功,试了网上很多的伪静态规则,都没法用
[font="]

https://docs.joomla.org/Nginx

官方这个伪静态规则说要改 [font="]PATH_ON_SERVER,请问在哪里改,我对niginx不熟悉...
望大虾分享一二..

展开
收起
抽烟的鱼 2016-12-15 22:20:22 5919 0
2 条回答
写回答
取消 提交回答
  • 回 1楼dongshan8的帖子
    centos 7

    -------------------------

    回 3楼dongshan8的帖子
    [警告] nginx-1.8 配置Rewrite规则错误,请查检改正。
    nginx: [emerg] "server" directive is not allowed here in /home/wwwroot/joomla/rewrite/joomla.conf:1
    nginx: configuration file /usr/local/nginx-1.8/conf/nginx.conf test failed



    大侠,我使用的是AMH5.3搭建的.报以上错误
    server {
            listen 80;
            server_name 我的域名;
            server_name_in_redirect off;

            access_log /var/log/nginx/localhost.access_log;
            error_log /var/log/nginx/localhost.error_log info;

            root home/wwwroot/joomla/; 路径这样对吗
            index index.php index.html index.htm default.html default.htm;
            # Support Clean (aka Search Engine Friendly) URLs
            location / {
                    try_files $uri $uri/ /index.php?$args;
            }

            # 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$ {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi.conf;
            }

            # caching of files
            location ~* \.(ico|pdf|flv)$ {
                    expires 1y;
            }

            location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                    expires 14d;
            }

    }

    谢谢
    2016-12-17 11:28:20
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    回 楼主(抽烟的鱼) 的帖子
    楼主您好,

    文档中提到的 PATH_ON_SERVER 应该指的是您的 joomla 程序网站所在的路径,如可能是在 /var/www/html/joomla

    您使用的系统是什么呢,Debian 8吗?

    -------------------------

    回 2楼(抽烟的鱼) 的帖子
    您好,

    请问解决问题了吗?

    如果还没有,我为您找个测试机来测试一下。

    -------------------------

    回 4楼(抽烟的鱼) 的帖子
    您好,

    我没有使用amh5.3,所以不确定nginx的配置文件加载详情,

    但从名字上来看,或许 server 节的内容已经在 vhost相关的文件中配置过了,不需要再将server写在rewrite的文件部分了。

    建议您对比下amh5.3自带的其它rewrite文件内容,看里边应该写些什么,不应该写些什么。
    2016-12-15 23:07:37
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Java开发手册1.1.0 立即下载
Java开发手册1.0.0版 立即下载
Java开发手册-孤尽秘传版 立即下载