Advertisement
Guest User

Untitled

a guest
Aug 9th, 2015
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.83 KB | None | 0 0
  1. #
  2. #/etc/nginx/sites-available/owncloud
  3. #
  4.  
  5. server {
  6.   listen 80;
  7.   server_name cloud.example.com;
  8.   server_name 192.168.1.47;
  9.  
  10.  
  11.   # Path to the root of your owncloud installation
  12.   root /var/www/owncloud/;
  13.   # set max upload size
  14.   client_max_body_size 10G;
  15.   fastcgi_buffers 64 4K;
  16.  
  17.   # Disable gzip to avoid the removal of the ETag header
  18.   gzip off;
  19.  
  20.   # Uncomment if your server is build with the ngx_pagespeed module
  21.   # This module is currently not supported.
  22.   #pagespeed off;
  23.  
  24.   rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  25.   rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  26.   rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  27.  
  28.   index index.php;
  29.   error_page 403 /core/templates/403.php;
  30.   error_page 404 /core/templates/404.php;
  31.  
  32.   location = /robots.txt {
  33.     allow all;
  34.     log_not_found off;
  35.     access_log off;
  36.     }
  37.  
  38.   location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
  39.     deny all;
  40.     }
  41.  
  42.   location / {
  43.    # The following 2 rules are only needed with webfinger
  44.    rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  45.    rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  46.  
  47.    rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  48.    rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  49.  
  50.    rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  51.  
  52.    try_files $uri $uri/ /index.php;
  53.    }
  54.  
  55.    location ~ \.php(?:$|/) {
  56.    fastcgi_split_path_info ^(.+\.php)(/.+)$;
  57.    include fastcgi_params;
  58.    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  59.    fastcgi_param PATH_INFO $fastcgi_path_info;
  60.       fastcgi_pass unix:/var/run/php5-fpm.sock;
  61.    }
  62.  
  63.    location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
  64.        expires 30d;
  65.        # Optional: Don't log access to assets
  66.          access_log off;
  67.    }
  68.  
  69.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement