Newer
Older
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
server {
listen 80;
server_name localhost;
root /var/www/site/htdocs;
# error_log /var/log/nginx/error_log warn;
index index.php;
charset utf-8;
location = /favicon.ico {
access_log off;
log_not_found off;
rewrite ^/favicon.ico$ https://shared.app.uib.no/img/uib-favicon.ico permanent;
}
location = /robots.txt {
access_log off;
log_not_found off;
return 200 "User-agent: *\nDisallow: /";
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/(fpm-status|ping)$ {
if ( $args ~ 'full' ) {
#Prevent information leaks
return 403;
}
fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
#Add small cache to limit abuse in case there is a varnish cache.
expires 10s;
}
location ~ /\.(?!well-known).* {
deny all;
}
}