群晖的nginx.conf编辑完当系统重启之后,nginx.conf会被系统恢复为原始状态,这样利用群晖nginx建虚拟主机的时候,会无法实现网站的伪静态!

下面是如何实现群晖虚拟主机的伪静态的方法:

我们可以找到/etc/nginx/app.d路径下的server.webstation-vhost.conf文件,找到下面的代码

include /usr/local/etc/nginx/conf.d/fee587e3-92f4-47d7-840c-f7e26557f102/user.conf*;
复制
最后的user.conf*文件上层文件夹的数字和字母组合是随机的,根据这段代码找到该路径,我们发现并没有user.conf*这个文件,建立一个空文件,然后写入你想加入的伪静态规则并保存,重启一下试试看吧 !是不是可以实现伪静态了?

希望对大家有帮助!

一、本地转到远程

1、论坛后台–全局–上传设置–启用远程附件

2、将本地附件目录data/attachment里面的文件夹移动到远程服务器上

3、数据库执行sql语句

论坛的

(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)

update pre_forum_attachment_0 set remote=1 where remote=0;

update pre_forum_attachment_1 set remote=1 where remote=0;

update pre_forum_attachment_2 set remote=1 where remote=0;

update pre_forum_attachment_3 set remote=1 where remote=0;

update pre_forum_attachment_4 set remote=1 where remote=0;

update pre_forum_attachment_5 set remote=1 where remote=0;

update pre_forum_attachment_6 set remote=1 where remote=0;

update pre_forum_attachment_7 set remote=1 where remote=0;

update pre_forum_attachment_8 set remote=1 where remote=0;

update pre_forum_attachment_9 set remote=1 where remote=0;

复制

门户的

update pre_portal_article_title set remote=1 where remote=0;

update pre_portal_attachment set remote=1 where remote=0;

update pre_portal_topic_pic set remote=1 where remote=0;

复制

相册的

{相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)}

相册目录:UPDATE pre_home_album SET picflag=replace (picflag,'1','2')

update pre_home_pic set remote=remote+1;

update pre_home_pic set remote=remote=2;
复制

二、远程转到本地

后台关闭远程附件设置,将附件移动到本地服务器的 data/attachment目录后执行sql即可

(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)

update pre_forum_attachment_0 set remote=0 where remote=1;

update pre_forum_attachment_1 set remote=0 where remote=1;

update pre_forum_attachment_2 set remote=0 where remote=1;

update pre_forum_attachment_3 set remote=0 where remote=1;

update pre_forum_attachment_4 set remote=0 where remote=1;

update pre_forum_attachment_5 set remote=0 where remote=1;

update pre_forum_attachment_6 set remote=0 where remote=1;

update pre_forum_attachment_7 set remote=0 where remote=1;

update pre_forum_attachment_8 set remote=0 where remote=1;

update pre_forum_attachment_9 set remote=0 where remote=1;

update pre_portal_article_title set remote=0 where remote=1;

update pre_portal_attachment set remote=0 where remote=1;

update pre_portal_topic_pic set remote=0 where remote=1;

update pre_home_pic set remote=remote-1;

复制

本地转远程
update pre_forum_attachment_0 set remote = '1' ;
update pre_forum_attachment_1 set remote = '1' ;
update pre_forum_attachment_2 set remote = '1' ;
update pre_forum_attachment_3 set remote = '1' ;
update pre_forum_attachment_4 set remote = '1' ;
update pre_forum_attachment_5 set remote = '1' ;
update pre_forum_attachment_6 set remote = '1' ;
update pre_forum_attachment_7 set remote = '1' ;
update pre_forum_attachment_8 set remote = '1' ;
update pre_forum_attachment_9 set remote = '1' ;
复制代码

远程转本地
update pre_forum_attachment_0 set remote = '0' ;
update pre_forum_attachment_1 set remote = '0' ;
update pre_forum_attachment_2 set remote = '0' ;
update pre_forum_attachment_3 set remote = '0' ;
update pre_forum_attachment_4 set remote = '0' ;
update pre_forum_attachment_5 set remote = '0' ;
update pre_forum_attachment_6 set remote = '0' ;
update pre_forum_attachment_7 set remote = '0' ;
update pre_forum_attachment_8 set remote = '0' ;
update pre_forum_attachment_9 set remote = '0' ;
复制代码
————————————————

是因为谷歌关闭了国内的谷歌翻译网页版 translate.google.cn ,因此连带着导致谷歌翻译 API 接口域名的解析也从国内 IP 改到了不可用的谷歌国外 IP,而谷歌国内服务器依然可用,所以只需手动在 Hosts 文件中将域名指向谷歌国内服务器 IP 即可。
怎么添加 Hosts?
打开编辑 Hosts 文件(修改该文件可能需要管理员权限)。

Windows 系统位置:C:\Windows\System32\drivers\etc\hosts
Linux / MacOS 系统位置:/etc/hosts
在文件中添加一行保存即可,格式示例(自己根据需求修改前面的 IP 地址):

220.181.174.226 translate.googleapis.com
该示例 IP 并不保证最新可用,因此添加之前,建议在 CMD 中 Ping IP 确保可用。
保存后,记得重启浏览器才能生效,如果还不行则尝试清空 DNS 缓存后(cmd 中执行 ipconfig /flushdns)再重启浏览器。
电信 北京:220.181.174.226
电信 上海:180.163.150.34

联通 北京:114.250.66.34
联通 广州:58.254.137.162

移动 上海:120.253.255.162

其他 北京:203.208.39.194
其他 上海:203.208.40.66
补充点可用的IP:

上海/电信:
180.163.150.34
180.163.151.34
180.163.151.162
180.163.150.162
180.163.150.33

上海/移动:
120.253.253.226
120.253.253.98
120.253.250.226
120.253.255.162
120.253.253.34
120.253.255.98
120.253.253.162
120.253.255.34

上海/Google数据中心/电信:
203.208.40.98
203.208.41.98
203.208.41.66
203.208.41.34
203.208.40.66
203.208.41.97
203.208.40.97
203.208.40.65
203.208.40.34

北京/电信:
220.181.174.226
220.181.174.34
220.181.174.98
220.181.174.162
220.181.174.33
203.208.50.162

北京/Google数据中心/电信:
203.208.43.66
203.208.39.194
203.208.50.66
203.208.43.98
203.208.50.34
203.208.39.226

北京/联通:
114.250.64.34
114.250.70.34
114.250.63.34
114.250.66.34
114.250.65.34

广州/电信:
113.108.239.226
58.63.233.98
113.108.239.162

广州/移动:
120.241.147.162
120.232.181.162

广州/联通:
58.254.137.226

1使用快捷键Ctrl+H打开“替换对话框”,在每行的开头添加内容。 (图中使用的文本编辑器为 NotePad++)
勾选左下角的“正则表达式”选项

2在“查找目标”里输入上尖号“^”,上尖号代表每行的开头
Notepad++ 技巧:将某个字串批量替换为 换行符,或批量取消换行
查找目标:空格
替换为:\r\n
查找模式:选择正则表达式

1、目录:/source/function/文件:function_member.php,查找:

$return = (!$login || (TIMESTAMP - $login['lastupdate'] > 900)) ? 5 : max(0, 5 - $login['count']);
复制代码

搜索第一个“900”,然后修改为你想要的秒数即可。

2、提示文字修改:目录:source\language文件:lang_message.php

搜索:

login_strike
复制代码

修改为下面类型效果即可。

'login_strike' => '密码错误次数过多,请 10 秒后刷新页面重新登录',
复制代码

然后上传覆盖对应的文件,更新缓存后再试即可。