-
Notifications
You must be signed in to change notification settings - Fork 4
/
nginx.conf
65 lines (55 loc) · 1.49 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location @handler {
rewrite ^/(.*)$ __PATH__/index.php?^$1 last;
}
location __PATH__/ {
# Path to source
alias __INSTALL_DIR__/;
index index.php;
# Réécriture vers l'index
try_files $uri $uri/ @handler;
# Parseur PHP
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
# Redirections
## Flux RSS
location ~ ^__PATH__/feed/ {
rewrite ^__PATH__/feed\/(.*)$ __PATH__/feed.php?^$1 last;
}
## Sitemap
location = __PATH__/sitemap.xml {
rewrite .* __PATH__/sitemap.php;
}
# Protections
location ~ ^__PATH__/(version|update|readme|data/configuration) {
deny all;
}
# Cache-control
location ~ ^__PATH__/data/ {
more_set_headers 'Cache-Control: public';
expires 12h;
}
location ~ ^__PATH__/core/ {
more_set_headers 'Cache-Control: public';
expires 12h;
}
location ~ ^__PATH__/plugins/ {
more_set_headers 'Cache-Control: public';
expires 12h;
}
location ~ ^__PATH__/themes/ {
more_set_headers 'Cache-Control: public';
expires 12h;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}