Commit 0400c127995e49ff6aec1ef9d43cec5dab8ef241
1 parent
d75a41ea16
Exists in
master
Update nginx.conf
Showing 1 changed file with 4 additions and 3 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; | 7 | fastcgi_buffers 64 4K; |
8 | 8 | ||
9 | rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; | 9 | rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; |
10 | rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; | 10 | rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; |
11 | rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; | 11 | rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; |
12 | 12 | ||
13 | index index.php; | 13 | index index.php; |
14 | error_page 403 /core/templates/403.php; | 14 | error_page 403 /core/templates/403.php; |
15 | error_page 404 /core/templates/404.php; | 15 | error_page 404 /core/templates/404.php; |
16 | 16 | ||
17 | rewrite ^/.well-known/host-meta /public.php?service=host-meta last; | 17 | rewrite ^/.well-known/host-meta /public.php?service=host-meta last; |
18 | rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; | 18 | rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; |
19 | 19 | ||
20 | rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; | 20 | rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; |
21 | rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; | 21 | rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; |
22 | 22 | ||
23 | rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; | 23 | rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; |
24 | 24 | ||
25 | try_files $uri $uri/ index.php; | 25 | try_files $uri $uri/ index.php; |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) { | 29 | location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) { |
30 | deny all; | 30 | deny all; |
31 | } | 31 | } |
32 | 32 | ||
33 | 33 | ||
34 | location ~ [^/]\.php(/|$) { | 34 | location ~ [^/]\.php(/|$) { |
35 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; | 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; |
36 | fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; | ||
37 | include fastcgi_params; | 36 | include fastcgi_params; |
38 | fastcgi_param REMOTE_USER $remote_user; | 37 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
39 | fastcgi_param PATH_INFO $fastcgi_path_info; | 38 | fastcgi_param PATH_INFO $fastcgi_path_info; |
40 | fastcgi_param HTTPS on; | 39 | fastcgi_param HTTPS on; |
40 | fastcgi_param REMOTE_USER $remote_user; | ||
41 | fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; | ||
41 | } | 42 | } |
42 | 43 | ||
43 | # Include SSOWAT user panel. | 44 | # Include SSOWAT user panel. |
44 | sub_filter </head> '<script type="text/javascript" src="/ynhpanel.js"></script></head>'; | 45 | sub_filter </head> '<script type="text/javascript" src="/ynhpanel.js"></script></head>'; |
45 | sub_filter_once on; | 46 | sub_filter_once on; |
46 | } | 47 | } |
47 | 48 | ||
48 | # Optional: set long EXPIRES header on static assets | 49 | # Optional: set long EXPIRES header on static assets |
49 | location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { | 50 | location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { |
50 | expires 30d; | 51 | expires 30d; |
51 | # Optional: Don't log access to assets | 52 | # Optional: Don't log access to assets |
52 | access_log off; | 53 | access_log off; |
53 | } | 54 | } |
54 | 55 | ||
55 | } | 56 | } |