forked from arthurfurlan/nginx-config-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery2.conf
56 lines (45 loc) · 1.29 KB
/
gallery2.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
server {
server_name example.com www.example.com;
listen 80;
listen 443;
# canonical domain
include /srv/example.com/nginx/conf/canonical_domain.conf;
# directory root
root /srv/example.com/nginx/www;
index index.php index.html index.htm;
# gallery2 configuration
location /gallery2/ {
alias /usr/share/gallery2/;
}
location ~ ^/gallery2/install/.*\.php$ {
# Add your secure hosts below:
#
# allow 127.0.0.1;
# allow 172.30.0.1;
# allow 192.168.0.1;
# allow 10.0.0.1;
deny all;
# document root in "/usr/share"!? yep, it's dirty...
root /usr/share;
if (!-f $document_root$fastcgi_script_name) {
rewrite ^ 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# default PHP andler
location ~ \.php$ {
if (!-f $document_root$fastcgi_script_name) {
rewrite ^ 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# logging
access_log /srv/example.com/nginx/log/access.log;
error_log /srv/example.com/nginx/log/error.log;
}