-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
55 lines (47 loc) · 1.18 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
worker_processes ${{NUM_WORKERS}};
error_log stderr notice;
daemon off;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
include gzip.nginx;
# https://gist.github.com/calind/1281950
# agent type detection, based on idea from from http://notnotmobile.appspot.com/
map $http_user_agent $agent_type_phase1 {
default 'mobile';
'' 'unknown';
~*iphone|ipod|blackberry|palm|windows\s+ce 'mobile';
~*windows|linux|os\s+[x9]|solaris|bsd 'desktop';
~*spider|crawl|slurp|bot|feedburner 'bot';
}
map $http_x_skyfire_phone $agent_type_phase2 {
default 'mobile';
'' $agent_type_phase1;
}
map $http_x_operamini_phone_ua $agent_type {
default 'mobile';
'' $agent_type_phase2;
}
server {
listen ${{PORT}};
lua_code_cache ${{CODE_CACHE}};
client_max_body_size ${{MAX_PASTA_SIZE}};
client_body_buffer_size ${{MAX_PASTA_SIZE}};
location / {
default_type text/html;
content_by_lua '
require("lapis").serve("pasta.app")
';
}
location /static/ {
alias static/;
expires 365d;
}
location /favicon.ico {
alias static/pasta/favicon.ico;
}
}
}