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