-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhttp.conf
More file actions
106 lines (106 loc) · 3.71 KB
/
Copy pathhttp.conf
File metadata and controls
106 lines (106 loc) · 3.71 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# map $http_x_forwarded_for $realip {
# ~^(\d+\.\d+\.\d+\.\d+) $1;
# default $remote_addr;
# }
map $http_x_forwarded_for $realip {
~^(\d+\.\d+\.\d+\.\d+) $1; # IPv4
~*([A-F0-9:]*) $1; # Very relaxed IPv6 regex
default $remote_addr;
}
map $http_origin $allow_origin {
include _SITE_ROOT_/cors-whitelist.map;
default '';
}
geoip2 _SITE_ROOT_/data/geoip/GeoIP2-City.mmdb {
auto_reload 60m;
$db_timestamp metadata build_epoch;
$db_last_check metadata last_check;
$db_last_change metadata last_change;
$continent_id source=$realip continent geoname_id;
$continent_code source=$realip continent code;
$continent_name source=$realip continent names en;
$country_id source=$realip country geoname_id;
$country_code source=$realip country iso_code;
$country_name source=$realip country names en;
$city_id source=$realip city geoname_id;
$city_name source=$realip city names en;
$location_acc source=$realip location accuracy_radius;
$location_lat source=$realip location latitude;
$location_lon source=$realip location longitude;
$location_timezone source=$realip location time_zone;
}
lua_shared_dict portal_stats 10m;
# server {
# listen 80;
# server_name __ENV_DOMAIN__;
# return 301 https://$host$request_uri;
# }
# server {
# #listen 443 ssl;ssl_certificate /etc/letsencrypt/live/__ENV_DOMAIN__/fullchain.pem;ssl_certificate_key /etc/letsencrypt/live/__ENV_DOMAIN__/privkey.pem;
# server_name dapi-staging.__ENV_DOMAIN__;
# return 301 https://dapi.__ENV_DOMAIN__$request_uri;
# }
server {
listen 80;
#__ENV_API_DOMAIN_SSL__
set $namespace __ENV_DOMAIN___admin;
set $site_root _SITE_ROOT_;
set $server_root _GBC_CORE_ROOT_;
set $redis_sock _GBC_CORE_ROOT_/tmp/redis.sock;
resolver 8.8.4.4 ipv6=off;
client_body_buffer_size 512K;
client_max_body_size 1G;
server_name dapi.__ENV_DOMAIN__ api.__ENV_DOMAIN__;
root _SITE_ROOT_/public/admin;
include _SITE_ROOT_/session.conf;
location / {
index index.html;
root _SITE_ROOT_/public;
}
# location /api/v1/hello {
# if ($http_mbrid = '') {
# return 200 '{"result":false, "err_code": 100}';
# }
# set_encrypt_session $session $http_mbrid;
# set_encode_base32 $session;
# return 200 $session;
# }
# location /config.json {
# root _SITE_ROOT_/public/admin;
# }
# location /myip {
# return 200 $realip;
# }
# location /demo {
# index index.html;
# alias _SITE_ROOT_/public/admin;
# }
# location /pages {
# index index.html;
# root _SITE_ROOT_/public;
# }
# location /icons {
# root _SITE_ROOT_/public/admin/assets;
# }
location /deploy/info/geoip {
alias _SITE_ROOT_/data/geoip;
}
location /_geoip_status {
return 200 '{"build": $db_timestamp,"last_check":$db_last_check,"last_change":$db_last_change}';
}
location /_geoip {
return 200 '{"ip":"$realip","continent": {"id": "$continent_id","code": "$continent_code","name": "$continent_name"},"country": {"id": "$country_id","code": "$country_code","name": "$country_name"},"city": {"id": "$city_id","name": "$city_name"},"location": {"accuracy_radius": "$location_acc","latitude": "$location_lat","longitude": "$location_lon","time_zone": "$location_timezone"}}';
}
location /deploy/_ssl {
alias _SITE_ROOT_/public/deploy/ssl;
}
location /deploy {
error_log _SITE_ROOT_/logs/deploy-error.log;
access_log _SITE_ROOT_/logs/deploy-access.log;
autoindex on;
index index.html;
root _SITE_ROOT_/public;
}
# _INCLUDE_APPS_ENTRY_
}
include _SITE_ROOT_/http.d/*.conf;