-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtor-nginx.conf
57 lines (47 loc) · 1.52 KB
/
tor-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
worker_processes 1;
events {
worker_connections 1024;
}
http {
types {
text/css css;
application/javascript js;
image/jpeg jpg;
image/jpeg jpeg;
image/png png;
image/gif gif;
}
server {
####################
# General Settings #
####################
listen unix:/var/sockets/nginx.sock;
root /var/www/html;
server_name _; # replace with your fully-qualified domain name
client_max_body_size 11M; #adjust the limit to be at least 1MB bigger than php's post_max_size
##################
# Location Rules #
##################
# Serve images and thumbs from the warehouse
# use alias instead of rewrite so nginx can determine the content-type
location ~ "^/_images/([0-9a-f]{2})([0-9a-f]{30}).*$" {
alias /var/www/html/data/images/$1/$1$2;
expires 30d;
}
location ~ "^/_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$" {
alias /var/www/html/data/thumbs/$1/$1$2;
expires 30d;
}
# Serve static files straight from disk, if they exist
location ~ "^.*\.(css|js|map|gif|png|jpg|jpeg|ico)$" {
try_files $uri /;
expires 1d;
}
# Have Shimmie handle everything else
location / {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_pass tor-php-fpm:9000;
}
}
}