-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.template
92 lines (74 loc) · 1.41 KB
/
nginx.conf.template
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
worker_processes 1;
error_log logs/error.log notice;
pid logs/nginx.pid;
env LJ_ROOT;
env OR_ROOT;
events {
worker_connections 1024;
}
http {
resolver 8.8.8.8;
client_body_temp_path temp/client_body;
proxy_temp_path temp/proxy;
fastcgi_temp_path temp/fastcgi;
uwsgi_temp_path temp/uwsgi;
scgi_temp_path temp/scgi;
client_max_body_size 100M;
init_by_lua_block {
require("pkg_config")
require("lpeg")
require("socket")
require("ltn12")
require("mime")
require("lsqlite3")
}
include mime.types;
server {
listen <%= listen %>;
lua_code_cache <%= lua_code_cache %>;
location / {
set $_url "";
allow 127.0.0.1;
deny all;
default_type text/html;
content_by_lua_block {
require("nginx_content")()
}
}
location /proxy {
internal;
rewrite_by_lua "
local req = ngx.req
for k,v in pairs(req.get_headers()) do
if k ~= 'content-length' then
req.clear_header(k)
end
end
if ngx.ctx.headers then
for k,v in pairs(ngx.ctx.headers) do
req.set_header(k, v)
end
end
";
resolver 8.8.8.8 ipv6=off;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_pass $_url;
}
location /static/ {
alias static/;
}
location /js/ {
alias static/js/;
}
location /css/ {
alias static/css/;
}
location /resources/ {
alias static/resources/;
}
location /favicon.ico {
alias static/favicon.ico;
}
}
}