API_ENDPOINT will point to chalice endpoint FRONTEND_ENDPOINT will point to frontend endpoint Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
26 lines
697 B
Text
26 lines
697 B
Text
# Ref: https://github.com/openresty/openresty/#resolvconf-parsing
|
|
resolver local=on;
|
|
# Need real ip address for flags in replay.
|
|
# Some LBs will forward real ips as x-forwarded-for
|
|
# So making that as priority
|
|
map $http_x_forwarded_for $real_ip {
|
|
~^(\d+\.\d+\.\d+\.\d+) $1;
|
|
default $remote_addr;
|
|
}
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 8080 default_server;
|
|
# listen [::]:80 default_server;
|
|
# server_name _;
|
|
|
|
set_by_lua_block $api_endpoint {return os.getenv("API_ENDPOINT")}
|
|
set_by_lua_block $frontend_endpoint {return os.getenv("FRONTEND_ENDPOINT")}
|
|
|
|
include /etc/nginx/conf.d/location.list;
|
|
client_max_body_size 10M;
|
|
}
|
|
|