-
Notifications
You must be signed in to change notification settings - Fork 43
/
app.conf
72 lines (51 loc) · 2.01 KB
/
app.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/
# https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/
###SET_UPSTREAM
###END_SET_UPSTREAM
server {
set $phpfpm_server ${APP_PHPFPM_DOCKER_SERVICE}:9000;
set $host_path $APP_PATH_SRC/public;
# Certification location
include snippets/ssl-certificates.conf;
# Strong TLS + TLS Best Practices
include snippets/ssl.conf;
# # NOTE: To use the HTTP challenge port 80 on NGINX must be open
# listen 80;
# include servers/shared/letsencrypt.conf;
# server listen (HTTPS)
listen 443 ssl http2;
http2_push_preload on;
http2_max_concurrent_pushes 25;
server_name .yourdomain.tld;
root $host_path;
# Redirect www to non-www
include snippets/www-to-non-www.conf;
more_clear_headers Content-Security-Policy Feature-Policy;
###BEGIN_GEOIP2
more_set_headers 'X-City: $geoip2_data_city_name';
more_set_headers 'X-Country: $geoip2_data_country_name';
if ($allowed_country = no) {
return 403;
}
###END_GEOIP2
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
#### Simple DDoS Defense / LIMITS
#### Control Simultaneous Connections
limit_conn conn_limit_per_ip 100;
limit_req zone=req_limit_per_ip burst=2000 delay=1000;
# Sets the status code to return in response to rejected requests
limit_conn_status 460;
limit_req_status 429;
}
# Several logs can be specified on the same level
error_log /var/log/nginx/app.error.log warn;
error_log /var/log/nginx/error.stderr.log warn;
# Sets the path, format, and configuration for a buffered log write
# # access_log /var/log/nginx/access.stdout.log main_json;
access_log /var/log/nginx/app.main.access.log main_json;
access_log /var/log/nginx/app.performance.access.log performance;
include snippets/deny.conf;
include snippets/php-fpm.conf;
include snippets/cache-static.conf;
}