Commit cd76ae3c7254e91cad9ff2f12f0b84e3953af7f3
1 parent
8ac2193a38
Exists in
master
Update nginx.conf
Showing 1 changed file with 39 additions and 6 deletions Inline Diff
conf/nginx.conf
1 | location PATHTOCHANGE { | 1 | location PATHTOCHANGE { |
2 | alias ALIASTOCHANGE; | 2 | alias ALIASTOCHANGE; |
3 | if ($scheme = http) { | 3 | if ($scheme = http) { |
4 | rewrite ^ https://$server_name$request_uri? permanent; | 4 | rewrite ^ https://$server_name$request_uri? permanent; |
5 | } | 5 | } |
6 | client_max_body_size 10G; | 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 | index index.php; | 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 | location ~ [^/]\.php(/|$) { | 40 | location ~ [^/]\.php(/|$) { |
10 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; | 41 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; |
11 | fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; | 42 | fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; |
12 | include fastcgi_params; | 43 | include fastcgi_params; |
13 | fastcgi_param REMOTE_USER $remote_user; | 44 | fastcgi_param REMOTE_USER $remote_user; |
14 | fastcgi_param PATH_INFO $fastcgi_path_info; | 45 | fastcgi_param PATH_INFO $fastcgi_path_info; |
15 | fastcgi_param HTTPS on; | 46 | fastcgi_param HTTPS on; |
16 | } | 47 | } |
17 | 48 | ||
18 | # Include SSOWAT user panel. | 49 | # Include SSOWAT user panel. |
19 | sub_filter </head> '<script type="text/javascript" src="/ynhpanel.js"></script></head>'; | 50 | sub_filter </head> '<script type="text/javascript" src="/ynhpanel.js"></script></head>'; |
20 | sub_filter_once on; | 51 | sub_filter_once on; |
21 | } | 52 | } |
22 | |||
23 | location ~ ^PATHTOCHANGE/(data|config|\.ht|db_structure\.xml|README) { | ||
24 | deny all; | ||
25 | } | ||
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; |