-
Notifications
You must be signed in to change notification settings - Fork 4
/
nginx.ophal.conf
57 lines (45 loc) · 1.18 KB
/
nginx.ophal.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
server {
listen 80;
server_name example.com;
root /path/to/document/root/;
location = / {
index index.cgi;
}
location / {
index index.cgi;
if (!-f $request_filename) {
rewrite ^(.*)$ /index.cgi last;
break;
}
if (!-d $request_filename) {
rewrite ^(.*)$ /index.cgi last;
break;
}
}
error_page 404 /index.cgi;
## All static files will be served directly.
location ~* ^.+\.(?:css|cur|js|jpg|jpeg|gif|htc|ico|png|html|xml|less|ttf|pdf|map)$ {
access_log off;
expires 30d;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=3000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
location ~ .cgi$ {
lua_code_cache off;
default_type text/html;
## Make sure to run Ophal on its document root
set_by_lua $_ '
require "lfs".chdir(ngx.var.document_root)
return nil
';
content_by_lua_file $request_filename;
}
access_log /var/log/nginx/example.com-access.log;
error_log /var/log/nginx/example.com-error.log;
}