Owncloud AMH面板配置文件

server
{
	listen       80;
	server_name 此处替换为域名; #server_name end
	index index.html index.htm index.php; #index end

	set $domain '';
        if ( $host ~* "(.+)\.(.+)\.(.+)" ) 
	{
                #set $domain "/$1"; #host subdirectory
        }
        if ( $domain = '/www' ) 
	{
                set $domain '';
        }

	root  /home/wwwroot/此处替换为域名/web$domain;
	include rewrite/amh.conf; #rewrite end
	client_max_body_size 10G;
	rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
	rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
	rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
	#error_page
	error_page 403 = /core/templates/403.php;
	error_page 404 = /core/templates/404.php;
        location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$ 
	{
                root /home/wwwroot/此处替换为域名/web;
        }

	location = /robots.txt {
		allow all;
		log_not_found off;
		access_log off;
	}
	location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
		deny all;
	}
	location / {
		# The following 2 rules are only needed with webfinger
		rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
		rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
		rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
		rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
		rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
		try_files $uri $uri/ index.php;
	}
	location ~ ^(.+?\.php)(/.*)?$ {
		try_files $1 = 404;
		include fastcgi_params;
		fastcgi_param PATH_INFO $2;
		fastcgi_pass  unix:/tmp/php-cgi-此处替换为域名.sock;
		fastcgi_index index.php;
		include fcgi-host.conf;
		fastcgi_param SCRIPT_FILENAME  /web$domain$fastcgi_script_name;
	}

	location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
		expires 30d;
	}

	location ~ .*\.(js|css)$
	{
		expires      12h;
	}

	access_log off; #access_log end
	error_log /home/wwwroot/此处替换为域名/log/error.log crit; #error_log end
}

以上文件根据原配置文件与owncloud官方配置文件进行修改,去除https,经测试可用

配置文件位于目录/usr/local/nginx/conf/vhost

AMH面板

原创文章,转载请注明: 转载自YXZ’s Blog

本文链接地址: Owncloud AMH面板配置文件

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>