前言
最近朋友一直在问我,Flarum论坛怎么在LNMP环境中安装呢?因为他安装后很明显的打不开后台,这就是一个比较尴尬的事情。
在后来翻阅官方文档后,这个问题就变的so 简单。
错误信息
打开后台出现404 分类无法打开 只有首页能进去错误解决
在Nginx下修改规则配置 将下面一段代码添加进你的服务器配置location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
fastcgi_index index.php;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
要记住重启服务器使Nginx配置生效!
此篇文章如何在LNMP环境下安装Flarum论坛由空白网络创作,转载请标注来源链接!如何在LNMP环境下安装Flarum论坛https://www.aihoom.com/982.html 如果您觉得我的网站笔记内容着实帮助到了你,请自行备份~
Hello friends!
I am an official representative of private company which deals with all kinds of written work (essay, coursework, dissertation, presentation, report, etc) in short time.
We are ready to offer a free accomplishment of written work hoping for further cooperation and honest feedback about our service.
This offer has limited quantities!!!
Details on our website:
https://essay-edu.biz
不管用,直接导致nginx掉线。
是否是nginx有大括号之类的没有看到? 复制一下nginx报错信息