Commit cd76ae3c7254e91cad9ff2f12f0b84e3953af7f3
1 parent
8ac2193a38
Exists in
master
Update nginx.conf
Showing 1 changed file with 39 additions and 6 deletions Side-by-side Diff
conf/nginx.conf
... | ... | @@ -4,8 +4,39 @@ location PATHTOCHANGE { |
4 | 4 | rewrite ^ https://$server_name$request_uri? permanent; |
5 | 5 | } |
6 | 6 | client_max_body_size 10G; |
7 | + fastcgi_buffers 64 4K; | |
8 | + | |
9 | + rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; | |
10 | + rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; | |
11 | + rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; | |
12 | + | |
7 | 13 | index index.php; |
8 | - try_files $uri $uri/ /index.php; | |
14 | + error_page 403 /core/templates/403.php; | |
15 | + error_page 404 /core/templates/404.php; | |
16 | + | |
17 | + location = /robots.txt { | |
18 | + allow all; | |
19 | + log_not_found off; | |
20 | + access_log off; | |
21 | + } | |
22 | + | |
23 | + location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) { | |
24 | + deny all; | |
25 | + } | |
26 | + | |
27 | + location / { | |
28 | + # The following 2 rules are only needed with webfinger | |
29 | + rewrite ^/.well-known/host-meta /public.php?service=host-meta last; | |
30 | + rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; | |
31 | + | |
32 | + rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; | |
33 | + rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; | |
34 | + | |
35 | + rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; | |
36 | + | |
37 | + try_files $uri $uri/ index.php; | |
38 | + } | |
39 | + | |
9 | 40 | location ~ [^/]\.php(/|$) { |
10 | 41 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; |
11 | 42 | fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; |
... | ... | @@ -18,9 +49,11 @@ location PATHTOCHANGE { |
18 | 49 | # Include SSOWAT user panel. |
19 | 50 | sub_filter </head> '<script type="text/javascript" src="/ynhpanel.js"></script></head>'; |
20 | 51 | sub_filter_once on; |
21 | -} | |
22 | - | |
23 | -location ~ ^PATHTOCHANGE/(data|config|\.ht|db_structure\.xml|README) { | |
24 | - deny all; | |
25 | -} | |
52 | + } | |
26 | 53 | |
54 | + # Optional: set long EXPIRES header on static assets | |
55 | + location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { | |
56 | + expires 30d; | |
57 | + # Optional: Don't log access to assets | |
58 | + access_log off; | |
59 | + } |