-
Notifications
You must be signed in to change notification settings - Fork 0
/
sova-admin.local.conf
100 lines (75 loc) · 2.95 KB
/
sova-admin.local.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
server {
listen 127.0.0.2:80;
listen 127.0.0.2:443 ssl spdy;
server_name sova-admin.local;
root /home/ISM-ECOMPANY/a.yegorov/projects/sova-admin/public_html;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.sova.log;
# Accept connections only for domains, located on this server, and send 444 if request address is different
if ($host !~ ^(sova-admin.local)$ ) {
return 444;
}
# Limit methods, allowed on server to GET, HEAD and POST
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
auth_basic "SOVA Access";
auth_basic_user_file /etc/nagios3/htpasswd.users;
charset UTF-8;
location / {
index index.php;
try_files $uri $uri/ @handler;
}
location ^~ /sova/ {
#rewrite /sova/ /;
index index.php;
try_files $uri $uri/ @sova_handler;
alias /home/ISM-ECOMPANY/a.yegorov/projects/sova/public_html/;
location ~ ^/sova/(.+\.php)(.*)$ {
## Execute PHP scripts
# if (!-e $request_filename) {
# rewrite / /sova/index.php last;
# } ## Catch 404s that try_files miss
fastcgi_split_path_info ^/sova/(.+\.php)(.*)$;
expires off; ## Do not cache dynamic content
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
fastcgi_read_timeout 5h;
# prepend XHProf header if xhprof cookie is set for profiling.
if ($cookie_xhprof) {
set $php_value "auto_prepend_file=/usr/local/share/php5/utilities/xhprof/header.php";
}
fastcgi_param PHP_VALUE $php_value;
fastcgi_param REQUEST_URI $request_uri;
}
}
location @sova_handler {
## A common front handler
rewrite /sova/ /sova/index.php;
}
location /. {
## Disable .htaccess and other hidden files
return 404;
}
location @handler {
## A common front handler
rewrite / /b1.php;
}
location ~ .php$ {
## Execute PHP scripts
if (!-e $request_filename) {
rewrite / /index.php last;
} ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
fastcgi_read_timeout 5h;
fastcgi_param REQUEST_URI $request_uri;
}
}