Ajout : forum.cyclocoop.org .
[lhc/ateliers.git] / etc / nginx / site.d / cyclo-forum-tls / site.conf
1 server_name forum.cyclocoop.org;
2
3 client_body_buffer_size 8k;
4 client_max_body_size 10m;
5
6 location = / {
7 root /usr/share/phpbb3/www;
8 index index.php;
9 }
10 location ~ /\. {
11 access_log off;
12 deny all;
13 log_not_found off;
14 return 403;
15 }
16 location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|store) {
17 deny all;
18 return 403;
19 }
20 location ~ ^/docs/ {
21 root /usr/share/phpbb3;
22 }
23 location ~* \.(gif|jpe?g|png|css)$ {
24 root /usr/share/phpbb3/www;
25 access_log off;
26 expires 30d;
27 log_not_found off;
28 }
29 location ~* ^.+\.php(|/.*)$ {
30 root /usr/share/phpbb3/www;
31 include /etc/nginx/conf.d/fastcgi.conf;
32 index index.php;
33 set $no_cache "0";
34 if ($request_method !~ ^(GET|HEAD)$) {
35 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
36 set $no_cache "1";
37 }
38 if ($no_cache = "1") {
39 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
40 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
41 add_header X-Microcachable "0";
42 }
43 if ($http_cookie ~* "_mcnc") {
44 # NOTE: bypass cache if no-cache cookie is set
45 set $no_cache "1";
46 }
47 expires epoch;
48 fastcgi_cache microcache;
49 fastcgi_cache_bypass $no_cache;
50 fastcgi_cache_use_stale error timeout invalid_header updating http_500;
51 fastcgi_cache_valid 200 1m;
52 fastcgi_cache_valid 301 2h;
53 fastcgi_cache_valid 302 30m;
54 fastcgi_cache_valid 404 10m;
55 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
56 fastcgi_index index.php;
57 fastcgi_split_path_info ^(.+\.php)(.*)$;
58 fastcgi_param PATH_INFO $fastcgi_path_info;
59 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
60 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
61 fastcgi_no_cache $no_cache;
62 fastcgi_param REDIRECT_STATUS 200;
63 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
64 fastcgi_pass_header Cookie;
65 fastcgi_pass_header Set-Cookie;
66
67 fastcgi_pass unix:/run/php5/fpm/cyclo_forum;
68 }
69
70 # vim: ft=sh