lovees 发表于 2017-8-1 03:24:34

Nextcloud 私有云在AMH下的配置和规则

本帖最后由 lovees 于 2017-8-1 09:12 编辑

一直没找到AMH FOR Nextcloud的配置和静态规则,花点时间自己配置了一个
[*]server
[*]{
[*]      listen 80;
[*]      server_name 你的域名; #server_name end
[*]#--------301 BEGIN      
[*]if ($server_port = 80) {
[*]    return 301 https://$server_name$request_uri;
[*]    }
[*]    if ($scheme = http) {
[*]    return 301 https://$server_name$request_uri;
[*]   }
[*]    error_page 497 https://$server_name$request_uri;
[*]#--------301 END
[*]      index index.html index.htm index.php; #index end
[*]
[*]      set $subdomain '';
[*]      root/home/wwwroot/你自己的空间路径/web$subdomain;
[*]      include rewrite/规则.conf; #rewrite end
[*]
[*]      #error_page
[*]      error_page 400 /ErrorPages/400.html;
[*]      error_page 403 /ErrorPages/403.html;
[*]      error_page 404 /ErrorPages/404.html;
[*]      error_page 502 /ErrorPages/502.html;
[*]      location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$
[*]      {
[*]                root /home/wwwroot/你自己的空间路径/web;
[*]      }
[*]    ##############此处注译掉############
[*]    #location ~ \.php(?:$|/)
[*]      #location ~ .*\.php$
[*]      #{
[*]      #      fastcgi_passunix:/tmp/php-cgi-Aadmin.sock;#注意此处php-cgi-Aadmin.sock 在规则里面需要使用
[*]      #      fastcgi_index index.php;
[*]      #      include fcgi-host.conf;
[*]      #      fastcgi_param DOCUMENT_ROOT/web$subdomain;
[*]      #      fastcgi_param SCRIPT_FILENAME/web$subdomain$fastcgi_script_name;
[*]      #}
[*]省略................}复制代码
静态规则
[*]    gzip off;
[*]      add_header X-Content-Type-Options nosniff;
[*]    add_header X-XSS-Protection "1; mode=block";
[*]    add_header X-Robots-Tag none;
[*]    add_header X-Download-Options noopen;
[*]    add_header X-Permitted-Cross-Domain-Policies none;
[*]               
[*]      location = /robots.txt {
[*]      allow all;
[*]      log_not_found off;
[*]      access_log off;
[*]    }
[*]    location = /.well-known/carddav {
[*]      return 301 $scheme://$host/remote.php/dav;
[*]    }
[*]    location = /.well-known/caldav {
[*]      return 301 $scheme://$host/remote.php/dav;
[*]    }
[*]      location / {
[*]      rewrite ^ /index.php$uri;
[*]    }
[*]
[*]    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
[*]      deny all;
[*]    }
[*]    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
[*]      deny all;
[*]    }
[*]    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v|updater/.+|ocs-provider/.+)\.php(?:$|/) {
[*]      fastcgi_split_path_info ^(.+\.php)(/.*)$;
[*]      include fcgi-host.conf;
[*]                fastcgi_param DOCUMENT_ROOT/web$subdomain;
[*]      fastcgi_param SCRIPT_FILENAME/web$subdomain$fastcgi_script_name;
[*]      fastcgi_param PATH_INFO $fastcgi_path_info;
[*]      fastcgi_param HTTPS on;
[*]      #Avoid sending the security headers twice
[*]      fastcgi_param modHeadersAvailable true;
[*]      fastcgi_param front_controller_active true;
[*]      fastcgi_passunix:/tmp/php-cgi-Aadmin.sock; 注意此处php-cgi-Aadmin.sock 在规则里面需要使用
[*]      fastcgi_intercept_errors on;
[*]      fastcgi_request_buffering off;
[*]    }      
[*]      location ~ ^/(?:updater|ocs-provider)(?:$|/) {
[*]   省略................
[*]    }      复制代码

详情或直接下载规则请到此:https://www.sxsay.net/787.html

wonkiall 发表于 2017-8-1 08:10:51

这个很实用

流河旱树 发表于 2017-8-1 08:24:23

这个好不好用的啊

lovees 发表于 2017-8-1 09:11:02


流河旱树 发表于 2017-8-1 08:24

这个好不好用的啊
测试5次全OK

martel 发表于 2017-8-1 08:24:00

ownCloud 是不是也可以?

lovees 发表于 2017-8-1 10:30:52


martel 发表于 2017-8-1 10:30

ownCloud 是不是也可以?
是的,都差不多!

lovees 发表于 2017-8-2 23:18:35

手机版我怎么找不到在哪备份通讯录啊?有那位大神知道啊!

baymin 发表于 2017-8-1 10:30:00

绑定
页: [1]
查看完整版本: Nextcloud 私有云在AMH下的配置和规则