Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (88 sloc) 3.16 KB
#
# FILE DISCONTINUED HERE
# UPDATED VERSION AT
# https://gitlab.com/yeupou/stalag13/raw/master/etc/nginx/sites-available/cloud
#
# | |
# \_V_//
# \/=|=\/
# [=v=]
# __\___/_____
# /..[ _____ ]
# /_ [ [ M /] ]
# /../.[ [ M /@] ]
# <-->[_[ [M /@/] ]
# /../ [.[ [ /@/ ] ]
# _________________]\ /__/ [_[ [/@/ C] ]
# <_________________>>0---] [=\ \@/ C / /
# ___ ___ ]/000o /__\ \ C / /
# \ / /....\ \_/ /
# ....\||/.... [___/=\___/
# . . . . [...] [...]
# . .. . [___/ \___]
# . 0 .. 0 . <---> <--->
# /\/\. . . ./\/\ [..] [..]
#
# more or less zeroconf for roundcube, assuming the rest is ok
# (php fastcgi spawned, owncloud installed
server {
listen 443; ## listen for ipv4
# catch all based on the domain name
server_name ~^cloud ~^nuage ~^prive;
access_log /var/log/nginx/cloud.access.log;
error_log /var/log/nginx/cloud.error.log;
# can be created with certs/makecert.sh
ssl on;
ssl_certificate certs/cloud.pem;
ssl_certificate_key certs/cloud.key;
ssl_session_timeout 5m;
# set for owncloud
root /usr/share/owncloud;
index index.php;
autoindex off;
allow all;
# from
location ~ /\. {
deny all;
access_log off;
}
# set max upload size
client_max_body_size 400M;
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
error_page 403 = /core/templates/403.php;
error_page 404 = /core/templates/404.php;
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location / {
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(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_params is part of nginx-common
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# serve static files by himself
# https://doc.owncloud.org/server/7.0/admin_manual/configuration/serving_static_files_configuration.html
fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
}
location ^~ /data {
# serve static files by himself
# https://doc.owncloud.org/server/7.0/admin_manual/configuration/serving_static_files_configuration.html
internal;
}
# Optional: set long EXPIRES header on static assets
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}