Skip to content

Instantly share code, notes, and snippets.

@techjawab
Created September 18, 2013 18:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save techjawab/6613256 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name 192.168.XXX.XXX;
rewrite ^ https://$server_name$request_uri? permanent; # enforce https
}
server {
listen 443 ssl;
server_name 192.168.XXX.XXX;
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/cert.key;
root /var/www/owncloud;
index index.php;
client_max_body_size 1000M; # set maximum upload size
fastcgi_buffers 64 4K;
location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location / {
try_files $uri $uri/ index.php;
}
location @webdav {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files $script_name = 404;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param HTTPS on;
fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment