全球主机交流论坛

标题: 哪位大佬有nextcloud的NGINX伪静态规则 [打印本页]

作者: shangpan    时间: 2019-5-6 21:06
标题: 哪位大佬有nextcloud的NGINX伪静态规则
百度了几个,都不行。
不知道哪位大佬有,用的是BT面板。
作者: rustylake    时间: 2019-5-6 21:25
请看nextcloud官方教程
作者: zkx    时间: 2019-5-6 22:05
https://www.zkxblog.com/technology/40.html
作者: shangpan    时间: 2019-5-6 22:07
rustylake 发表于 2019-5-6 21:25
请看nextcloud官方教程

看了,也百度了。。可是还没有搞定。
作者: 夕日    时间: 2019-5-6 22:54
官方文档不是有吗?
作者: lovees    时间: 2019-5-6 22:56
https://www.sxsay.com/807.html
好几年了,运行正常
  1. gzip off;
  2.     add_header X-Content-Type-Options nosniff;
  3.     add_header X-XSS-Protection "1; mode=block";
  4.     add_header X-Robots-Tag none;
  5.     add_header X-Download-Options noopen;
  6.     add_header X-Permitted-Cross-Domain-Policies none;
  7.                 location = /robots.txt {
  8.         allow all;
  9.         log_not_found off;
  10.         access_log off;
  11.     }
  12.     rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  13.     rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  14.     location / {
  15.     try_files $uri/ /index.php?/$uri;
  16.     }
  17.     location /admin.php {
  18.     try_files $uri $uri/ /admin.php;
  19.     }
  20.     location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  21.         deny all;
  22.     }
  23.     location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  24.         deny all;
  25.     }
  26.     location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
  27.         fastcgi_split_path_info ^(.+\.php)(/.*)$;
  28.         fastcgi_param PATH_INFO $fastcgi_path_info;
  29.         fastcgi_param HTTPS on;
  30.         fastcgi_param front_controller_active true;
  31.       }
  32.         location ~ ^/(?:updater|ocs-provider)(?:$|/) {
  33.         try_files $uri/ =404;
  34.         index index.php;
  35.     }
  36.     location ~ \.(?:css|js|woff|svg|gif)$ {
  37.         try_files $uri /index.php$uri$is_args$args;
  38.       }
  39.     location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  40.         try_files $uri /index.php$uri$is_args$args;
  41.       }       
复制代码

作者: aRNoLD    时间: 2019-5-6 23:02
不同的版本(目前大多安装的是15版)官方的配置文件稍有不同,可在页面左下角调版本

https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-the-webroot-of-nginx
作者: shangpan    时间: 2019-5-6 23:56
本帖最后由 shangpan 于 2019-5-6 23:58 编辑
lovees 发表于 2019-5-6 22:56
https://www.sxsay.com/807.html
好几年了,运行正常


老哥你这个博客里面的这个我试过了,不行。
伪静态加上了,还要在config.php里面添加一行
htaccess.IgnoreFrontController' => true'
才可以生效吧,
然后打开页面就404了
作者: lovees    时间: 2019-5-7 00:04
shangpan 发表于 2019-5-6 23:56
老哥你这个博客里面的这个我试过了,不行。
伪静态加上了,还要在config.php里面添加一行
htaccess.Ignor ...

看到这句了吗?
需要根据你的版本更改v[12]
具体看你安装的
  1. ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
复制代码

作者: shangpan    时间: 2019-5-7 00:30
lovees 发表于 2019-5-7 00:04
看到这句了吗?
需要根据你的版本更改v[12]
具体看你安装的

根据你提供的代码,我都对照官方改了一下,还是有些东西不加载,登录也不能登录

config.php文件里面除了要添加htaccess.IgnoreFrontController' => true',这个以后,还需要添加别的吗?
作者: shangpan    时间: 2019-5-7 00:42
lovees 发表于 2019-5-7 00:04
看到这句了吗?
需要根据你的版本更改v[12]
具体看你安装的

貌似好了,现在后台共享打开还是空白的,别的应该都正常了。我是替换整个虚拟主机的文件。
作者: fl20002    时间: 2019-5-7 00:59
https://www.fmqcloud.com/archives/nextcloud.html
作者: shangpan    时间: 2019-5-7 01:04
fl20002 发表于 2019-5-7 00:59
https://www.fmqcloud.com/archives/nextcloud.html

谢谢了,我再来研究一下。




欢迎光临 全球主机交流论坛 (https://loc.516000.xyz/) Powered by Discuz! X3.4