owncloud nginx php,nginx配置owncloud记录。

开始配置时忘看php-fpm配置

结果这里 server unix:/dev/shm/php-cgi.sock; 一直502,后面加上了错误日志输出,才发现问题。

upstream php-handler {

server unix:/dev/shm/php-cgi.sock; ##开始没注意这里,一直502

# Depending on your used PHP version

}

server {

listen 80;

server_name cloud.yun.cn;

# For Lets Encrypt, this needs to be served via HTTP

# location /.well-known/acme-challenge/ {

root /data/wwwroot/owncloud; # Specify here where the challenge file is placed

# }

# enforce https

location / {

return 301 https://$server_name$request_uri;

}

}

server {

listen 443 ssl http2;

server_name cloud.yun.cn;

ssl_certificate /usr/local/nginx/conf/ssl/yun.cn.crt;

ssl_certificate_key /usr/local/nginx/conf/ssl/yun.cn.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

ssl_prefer_server_ciphers on;

ssl_session_timeout 10m;

ssl_session_cache builtin:1000 shared:SSL:10m;

ssl_buffer_size 1400;

add_header Strict-Transport-Security max-age=15768000;

ssl_stapling on;

ssl_stapling_verify on;

access_log /data/wwwlogs/cloud.yun.cn_nginx.log combined;

error_log /data/wwwlogs/cloud.yun.cn_error.log;

root /data/wwwroot/owncloud;

index index.php index.html;

if ($ssl_protocol = "") { return 301 https://$host$request_uri; }

# Add headers to serve security related headers

# Before enabling Strict-Transport-Security headers please read into this topic first.

#add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";

add_header X-Content-Type-Options nosniff;

add_header X-Frame-Options "SAMEORIGIN";

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;

# Path to the root of your installation

location = /robots.txt {

allow all;

log_not_found off;

access_log off;

}

# The following 2 rules are only needed for the user_webfinger app.

# Uncomment it if you're planning to use this app.

rewrite ^/.well-known/host-meta /public.php?service=host-meta last;

rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

location = /.well-known/carddav {

return 301 $scheme://$host/remote.php/dav;

}

location = /.well-known/caldav {

return 301 $scheme://$host/remote.php/dav;

}

# set max upload size

client_max_body_size 512M;

fastcgi_buffers 4 64K; # Please see note 1

fastcgi_ignore_headers X-Accel-Buffering; # Please see note 2

# Disable gzip to avoid the removal of the ETag header

# Enabling gzip would also make your server vulnerable to BREACH

# if no additional measures are done. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773332

gzip off;

# Uncomment if your server is build with the ngx_pagespeed module

# This module is currently not supported.

#pagespeed off;

error_page 403 /core/templates/403.php;

error_page 404 /core/templates/404.php;

location / {

rewrite ^ /index.php$uri;

}

location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {

return 404;

}

location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {

return 404;

}

location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {

fastcgi_split_path_info ^(.+\.php)(/.*)$;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param SCRIPT_NAME $fastcgi_script_name; # necessary for owncloud to detect the contextroot https://github.com/owncloud/core/blob/v10.0.0/lib/private/AppFramework/Http/Request.php#L603

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param HTTPS on;

fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice

fastcgi_param front_controller_active true;

fastcgi_read_timeout 180; # increase default timeout e.g. for long running carddav/ caldav syncs with 1000+ entries

fastcgi_pass php-handler;

fastcgi_intercept_errors on;

fastcgi_request_buffering off; #Available since NGINX 1.7.11

}

location ~ ^/(?:updater|ocs-provider)(?:$|/) {

try_files $uri $uri/ =404;

index index.php;

}

# Adding the cache control header for js and css files

# Make sure it is BELOW the PHP block

location ~ \.(?:css|js)$ {

try_files $uri /index.php$uri$is_args$args;

add_header Cache-Control "max-age=15778463";

# Add headers to serve security related headers (It is intended to have those duplicated to the ones above)

# Before enabling Strict-Transport-Security headers please read into this topic first.

#add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";

add_header X-Content-Type-Options nosniff;

add_header X-Frame-Options "SAMEORIGIN";

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;

# Optional: Don't log access to assets

access_log off;

}

location ~ \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg|map)$ {

add_header Cache-Control "public, max-age=7200";

try_files $uri /index.php$uri$is_args$args;

# Optional: Don't log access to other assets

access_log off;

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/422136.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

前端学习(582):实现观看和调试dom节点

1双击编辑修改 2修改dom 右击edit as html 3复制粘贴

php解析html数组,HTML中如何处理PHP传递的三维数组

需求描述:从 PHP 拿过来一组三维数组,现在想要通过 JQ/JS 获取里面数据。如何在页面中正确获取 {$layer} 的数组(不需要显示)?JQ/JS 分别获取数据?HTMLprint_r($layer);打印结果Array([id] > 2387[image] > /Public/upload/…

无法打开用户默认数据库,登录失败,用户‘sa’登录失败,错误:4064的解决方法...

无法打开用户默认数据库,登录失败,这是因为登录帐户的默认数据库被删除。解决方案:用windows身份模式进入,选择“安全性”---"登录名"------“HRKJ”,在HRKJ上右击,弹出如图窗口,找到…

php deprecated,解决php中each函数在7.2版本提示deprecated错误问题

今天有个thinkphp5.0版本的项目切换到php7.2版本,有个页面一直报错,打开调试代码。发现错误提示“The each() function is deprecated. This message will be suppressed on further calls”。说明php不建议继续使用each函数了,那如何修改代码…

前端学习(584):在dom中调试节点

第一种方式 修改完成 第二种 删除标签 执行 第三种 执行 删除

asp.net调用百度地图API,实现电子地图

http://openapi.baidu.com/map/index.html 例子&#xff1a; <% Page Language"C#" AutoEventWireup"true" CodeFile"Default2.aspx.cs" Inherits"Default2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transiti…

php订阅系统,php redis pub/sub(Publish/Subscribe,发布/订阅的信息系统)之基本使用

一.场景介绍最近的一个项目需要用到发布/订阅的信息系统&#xff0c;以做到最新实时消息的通知。经查找后发现了redis pub/sub(发布/订阅的信息系统)可以满足我的开发需求,而且学习成本和使用成本也比较低。二.什么是redis pub/sub资料查看大家在看我的blog的同时可以打开redis…

SQL Server 自定义函数 返回树结构函数

数据库结构: 表内的数据: 自定义函数: 递归查出 树下所有节点 ,参数是 父idcreate function sss(id as int)returns t table(id int not null,name int not null,pid int null)asbegindeclare lay as int;insert into t select * from tree where pid id;select lay min(id) …

php 生成器作用,php 生成器的理解和使用

image.png开头介绍的这个文章总结的很详细&#xff0c;而且大多的介绍其实都是这么写的&#xff0c;也是这些例子。但是手册的介绍也很重要。此处&#xff0c;我主要写一些个人的理解要点1.生成其是一种更容易实现简单对象迭代。所以他的本质其实是相当于有助于更好的实现 fore…

沈向洋谈文献阅读(转载)

1. 很多研究者话费一半以上的时间用来阅读。在研究生开始两年&#xff0c;除了应付功课&#xff0c;其余的时间阅读有关于你topic的课本和journal articles。 2. 了解自己相关topic最为核心的杂志。每年去图书馆翻阅过去一年相关大学的研究者做出的引起你兴趣的technical repor…

php访问url json,PHP操作URL和PHP操作json

摘要&#xff1a;<?php //url$string 我爱 中国;$string htmlspecialchars($string);echo $strin<?php //url$string 我爱 中国;$string htmlspecialchars($string);echo $string;echo ;$url http://www.bai du.com;echo $url urldecode($url);echo ;echo $url …

hdu 3079水题

水到什么都不想说了。 /** hdu3079/win.cpp* Created on: 2012-11-4* Author : ben*/ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> …

java maximumpoolsize,如果maximumPoolSize小于corePoolSize怎么办? Java 6中可能存在的错误?...

我遇到了Java 6的ThreadPoolExecutor一个奇怪的问题 . 我不时地动态更改了corePoolSize&#xff0c;我观察到线程池没有处理应该完成的任务 .例如&#xff0c;如果我有4个corePoolSize并且队列中有许多任务等待&#xff0c;那么执行程序最多处理3个&#xff0c;有时甚至是2个 .…

print\println\printf的区别

print\println\printf的区别 print将它的参数显示在命令窗口&#xff0c;并将输出光标定位在所显示的最后一个字符之后。 println 将它的参数显示在命令窗口&#xff0c;并在结尾加上换行符&#xff0c;将输出光标定位在下一行的开始。 printf是格式化输出的形式。 下在举个例子…