-
Notifications
You must be signed in to change notification settings - Fork 2
/
nginx.production.conf
100 lines (83 loc) · 3.04 KB
/
nginx.production.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
worker_processes ${{NUM_WORKERS}};
error_log ${{LOG_FILE}} ${{LOG_LEVEL}};
daemon on;
pid ${{PID_FILE}};
events {
worker_connections 1024;
}
http {
lua_package_path './?.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua';
lua_package_cpath '/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/lib/lua/5.1/loadall.so;./?.so';
include mime.types;
variables_hash_max_size 1024;
resolver 8.8.8.8 8.8.4.4;
client_max_body_size ${{FILESIZE_LIMIT}};
server {
server_name csnedelja.mg.edu.rs www.csnedelja.mg.edu.rs;
listen ${{PORT}};
return 301 $scheme://ni.mg.edu.rs$request_uri;
}
server {
server_name ni.mg.edu.rs www.ni.mg.edu.rs localhost;
listen ${{PORT}};
lua_code_cache ${{CODE_CACHE}};
location / {
auth_basic "U izradi";
auth_basic_user_file /etc/apache2/.htpasswd;
set $_url "ngin";
default_type text/html;
content_by_lua '
require("lapis").serve("app")
';
}
location /dashboard {
allow 127.0.0.1;
default_type text/html;
content_by_lua '
require("lapis").serve("app")
';
auth_basic "Hello friend";
auth_basic_user_file /etc/apache2/.htpasswd;
}
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;
proxy_http_version 1.1;
proxy_pass $_url;
}
location /static/ {
alias static/;
error_page 404 = /404;
}
location /favicon.ico { alias static/favicon.ico; }
location /apple-touch-icon.png { alias static/apple-touch-icon.png; }
location /favicon-32x32.png { alias static/favicon-32x32.png; }
location /favicon-16x16.png { alias static/favicon-16x16.png; }
location /manifest.json { alias static/manifest.json; }
location /safari-pinned-tab.svg { alias static/safari-pinned-tab.svg; }
location /android-chrome-192x192.png { alias static/android-chrome-192x192.png; }
location /android-chrome-256x256.png { alias static/android-chrome-256x256.png; }
location /mstile-150x150.png { alias static/mstile-150x150.png; }
location /browserconfig.xml { alias static/browserconfig.xml; }
}
server {
listen ${{PORT}} default_server;
server_name _;
location / {
return 403;
}
}
}