-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
54 lines (49 loc) · 1.35 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
worker_processes 4;
error_log stderr notice;
daemon on;
events {
worker_connections 1024;
}
http {
include mime.types;
client_body_buffer_size 10m;
client_max_body_size 10m;
include "phpsite.conf";
server {
gzip on;
gzip_disable "msie6";
gzip_vary on;
listen 8080;
lua_code_cache off;
set $session_secret 623q4hR325t36VsCD3g567922IC0073T;
set $session_cookie_persistent on;
set $session_cookie_lifetime 360000;
set $home "/var/www/restyweb";
set $home "/home/ryanwidi/www/restyweb";
default_type text/html;
location /{
set $target '';
access_by_lua '
lfs=require("lfs")
lfs.chdir(ngx.var.home)
uri=ngx.var.uri
if uri == "/" then
ngx.var.target="/app.lua"
elseif string.sub(uri,#uri)=="/" then
ngx.var.target=uri
elseif string.sub(uri,#uri-3)==".lua" then
ngx.var.target=uri
else
ngx.var.target=uri..".lua"
end
';
content_by_lua_file '$home$target';
}
location /static/ {
alias $home/static/;
}
location /favicon.ico {
alias static/favicon.ico;
}
}
}