diff options
| author | 2026-10-22 20:12:08 +0000 | |
|---|---|---|
| committer | 2026-10-22 20:12:08 +0000 | |
| commit | 782e4429c89c6e91cd9aa7e5ba59517a52200dcd (patch) | |
| tree | e7191c9c998070d9393ce22748ebcfa859991dc0 /roles/nginx/templates/nginx.conf.j2 | |
| parent | feat: add fail2ban (diff) | |
| download | infra-782e4429c89c6e91cd9aa7e5ba59517a52200dcd.tar.gz | |
feat: add nginx
Diffstat (limited to 'roles/nginx/templates/nginx.conf.j2')
| -rw-r--r-- | roles/nginx/templates/nginx.conf.j2 | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/roles/nginx/templates/nginx.conf.j2 b/roles/nginx/templates/nginx.conf.j2 new file mode 100644 index 0000000..110fa02 --- /dev/null +++ b/roles/nginx/templates/nginx.conf.j2 | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # {{ ansible_managed }} | ||
| 2 | user nginx; | ||
| 3 | error_log /var/log/nginx/error.log warn; | ||
| 4 | pid /var/run/nginx/nginx.pid; | ||
| 5 | |||
| 6 | worker_processes auto; | ||
| 7 | worker_rlimit_nofile 65535; | ||
| 8 | |||
| 9 | events { | ||
| 10 | worker_connections 4096; | ||
| 11 | use epoll; | ||
| 12 | multi_accept on; | ||
| 13 | } | ||
| 14 | |||
| 15 | http { | ||
| 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
| 17 | '$status $body_bytes_sent "$http_referer" ' | ||
| 18 | '"$http_user_agent" "$http_x_forwarded_for"'; | ||
| 19 | access_log /var/log/nginx/access.log main; | ||
| 20 | |||
| 21 | sendfile on; | ||
| 22 | tcp_nopush on; | ||
| 23 | tcp_nodelay on; | ||
| 24 | server_tokens off; | ||
| 25 | keepalive_timeout 65; | ||
| 26 | |||
| 27 | client_body_buffer_size 512k; | ||
| 28 | client_max_body_size 64M; | ||
| 29 | |||
| 30 | default_type application/octet-stream; | ||
| 31 | include /etc/nginx/mime.types; | ||
| 32 | include /etc/nginx/http.d/*.conf; | ||
| 33 | } | ||
