site/nginx.conf

73 lines
1.3 KiB
Nginx Configuration File

worker_processes ${{NUM_WORKERS}};
error_log stderr notice;
daemon off;
env PORT;
env GITHUB_TOKEN;
env GIT_REV;
env MAILGUN_KEY;
env PASSWORD;
env OLEG_PORT_38080_TCP_ADDR;
env OLEG_PORT_38080_TCP_PORT;
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen ${{PORT}};
lua_code_cache ${{CODE_CACHE}};
location / {
set $_url "";
default_type text/html;
content_by_lua '
require("lapis").serve("app")
';
}
location /static/ {
alias static/;
}
location /favicon.ico {
alias static/favicon.ico;
}
location /apple-touch-icon.png {
alias static/img/avatar.png;
}
location /humans.txt {
alias static/humans.txt;
}
location /keybase.txt {
alias static/keybase.txt;
}
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;
}
}
}