容器技术交流

 找回密码
 立即注册
查看: 7844|回复: 5

请教Lumanager Nginx 如何配置Joomla的伪静态?

[复制链接]
发表于 2013-4-24 11:25:08 | 显示全部楼层 |阅读模式
本帖最后由 丁不三 于 2013-4-24 11:43 编辑

我在Lumanager后台Nginx扩展设置(server段)里按照Joomla官方给出的如下规则换为自己的域名及目录确认保存后,lumanager会提示“表单令牌错误”,请教这种情况如何解决?盼复,多谢!
server {
        listen 80;
        server_name YOUR_DOMAIN;
        server_name_in_redirect off;

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

        root PATH_ON_SERVER;
        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 ies
        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;
        }

}





发表于 2013-4-24 16:50:40 | 显示全部楼层
换个浏览器,这个应该是浏览器不兼容的原因吧,换火狐或者谷歌
 楼主| 发表于 2013-4-24 21:10:50 | 显示全部楼层
本帖最后由 丁不三 于 2013-4-24 21:21 编辑

多谢!

我用谷歌Chrome会出现 表单令牌错误,换用Firefox可以修改成功。
但是在检测网站配置错误时会出现错误提示:

ID为2的网站配置有错
错误信息
nginx: [emerg] "server" directive is not allowed here in /usr/local/nginx/conf/vhost.test.conf:120 nginx: configuration file /usr/local/nginx/conf/vhost.test.conf test failed

请教如何处理这个错误?
注:这个域名设置是 ”仅PHP用Apache处理。将动态的PHP脚本交给Apache处理,即前端Nginx,后端Apache “
 楼主| 发表于 2013-4-26 11:43:00 | 显示全部楼层
没有人知道吗?
 楼主| 发表于 2013-5-1 03:01:24 | 显示全部楼层
看来在Lumanager 的nginx下搭建Joomla站点的用户还是比较少
发表于 2014-6-15 18:49:21 | 显示全部楼层
Nginx下Joomla伪静态write规则只要一行:

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}

#添加这行在:
Nginx扩展设置
(location段)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2024-5-3 01:49 , Processed in 0.029663 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表