forked from coinkite/cloudfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
108 lines (82 loc) · 2.36 KB
/
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
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
101
102
103
104
105
106
107
108
pid logs/nginx.pid;
# like my logs mixed together
#error_log logs/error.log;
error_log logs/error.log info;
worker_processes 1;
events {
worker_connections 1024;
}
http {
access_log logs/access.log;
include /usr/local/etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/plain;
# nginx stuff
sendfile on;
#keepalive_timeout 65;
server_tokens off;
server_name_in_redirect on;
# LUA setup
lua_package_path "${prefix}/lua/?.lua;;";
#lua_code_cache off; # DEBUG only
lua_shared_dict sessions 256k;
lua_shared_dict seeds 256k;
lua_shared_dict config 32k;
init_by_lua_file 'lua/init.lua';
server {
#listen 80 so_keepalive=30s:30s:8;
listen 80;
# kill log noise during debug
location = /favicon.ico { return 404; }
location = /robots.txt { return 404; }
location = /___ {
# callback for browser checking
content_by_lua_file 'lua/create.lua';
}
location ~ "/__A__/(?<admin_cmd>[a-z]*)" {
# admin/control access
access_by_lua_file 'lua/before.lua';
content_by_lua_file 'lua/admin.lua';
}
location ~ "/__S__/([a-f0-9]{16,64})(.*)$" {
internal;
# static files; stored by hash w/ extension
default_type "text/html; charset=utf-8";
#boring#add_header X-Hit $1;
alias static/$1$2;
}
location = /__W__ {
# Websockets come in here
access_by_lua_file 'lua/before.lua';
content_by_lua_file 'lua/pusher.lua';
}
location /__F__/ {
internal;
# deliver content via FastCGI running elsewhere - dynamic content
include fastcgi_params.conf;
fastcgi_param SCRIPT_NAME '';
# add each vhost here
location /__F__/lh {
fastcgi_pass 127.0.0.1:9999;
}
location /__F__/cloudfire-demo.coinkite.com {
fastcgi_pass 127.0.0.1:9999;
}
}
location / {
# most pages will come here
access_by_lua_file 'lua/before.lua';
content_by_lua_file 'lua/content.lua';
}
# send all errors to lua
error_page 400 401 402 403 405 429 500 501 503 @error_page;
error_page 404 @error_page;
location @error_page {
content_by_lua_file 'lua/errors.lua';
}
error_page 502 @placeholder_page;
location @placeholder_page {
content_by_lua_file 'lua/placeholder.lua';
}
}
}