-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustom-nginx.conf
More file actions
85 lines (72 loc) · 1.85 KB
/
custom-nginx.conf
File metadata and controls
85 lines (72 loc) · 1.85 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
client_max_body_size 0;
root /var/www/glpi/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php$ {
fastcgi_pass glpi-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Deny access to files, config and marketplace directory
location ~ ^/(config|files|marketplace|plugins)/ {
deny all;
access_log off;
log_not_found off;
}
# Disable .htaccess and other hidden files except .well-known
location ~ /\.(?!well-known).* {
deny all;
access_log off;
log_not_found off;
}
# Access the NGINX status page, also known as ngx_http_stub_status_module
location /status/nginx {
stub_status on;
access_log off;
allow all;
#allow 127.0.0.1;
#allow 127.0.0.0/8;
#allow 10.0.0.0/8;
#allow 172.16.0.0/12;
#allow 192.168.0.0/16;
deny all;
}
# Access the PHP-FPM status page
location /status/fpm {
fastcgi_pass glpi-fpm:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
allow all;
#allow 127.0.0.1;
#allow 127.0.0.0/8;
#allow 10.0.0.0/8;
#allow 172.16.0.0/12;
#allow 192.168.0.0/16;
deny all;
}
# Access the PHP info page
location /info.php {
fastcgi_pass glpi-fpm:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
allow all;
#allow 127.0.0.1;
#allow 127.0.0.0/8;
#allow 10.0.0.0/8;
#allow 172.16.0.0/12;
#allow 192.168.0.0/16;
deny all;
}
}