Created
April 29, 2012 15:35
-
-
Save corpix/2551325 to your computer and use it in GitHub Desktop.
Own Cloud nginx config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name cloud.yourhost.ru; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
# HTTPS | |
server { | |
listen 443 ssl; | |
server_name cloud.yourhost.ru; | |
ssl_certificate /etc/nginx/certs/owncloud.crt; | |
ssl_certificate_key /etc/nginx/certs/owncloud.key; | |
root /storage/owncloud/scripts/; | |
index index.php; | |
client_max_body_size 5G; | |
location ~ ^/(data|config|\.|db_structure\.xml) { | |
deny all; | |
} | |
location /dav/ { | |
fastcgi_param SCRIPT_FILENAME /storage/owncloud/scripts/files/webdav.php; | |
include fastcgi_params; | |
root /storage/owncloud/scripts/files; | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
} | |
location / { | |
try_files $uri $uri/ @webdav; | |
} | |
location @webdav { | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS on; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
} | |
location ~ \.php$ { | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS on; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment