blob: c70f7a01ef7f3864b0b964f672aa01c50d06e8d3 [file] [log] [blame]
Filip Pytlound8986a62016-02-17 17:47:37 +01001{%- from "nginx/map.jinja" import server with context -%}
Filip Pytloun9e0846d2016-02-17 17:49:22 +01002user {{ server.system_user }};
Filip Pytlound8986a62016-02-17 17:47:37 +01003worker_processes {{ server.get('worker', {}).get('processes', 'auto') }};
Petr Michalec7c798832016-09-12 15:50:06 +02004worker_rlimit_nofile {{ server.get('worker', {}).get('limit', {}).get('nofile', '20000') }};
Filip Pytloun6b5bb652015-10-06 16:28:32 +02005pid /run/nginx.pid;
6
Petr Michalec83981452016-09-12 14:46:50 +02007
Filip Pytloun6b5bb652015-10-06 16:28:32 +02008events {
Filip Pytlound8986a62016-02-17 17:47:37 +01009 worker_connections {{ server.get('worker', {}).get('connections', '1024') }};
Filip Pytloun6b5bb652015-10-06 16:28:32 +020010 # multi_accept on;
11}
12
13http {
14
15 ##
16 # Basic Settings
17 ##
18
19 sendfile on;
20 tcp_nopush on;
21 tcp_nodelay on;
22 keepalive_timeout 65;
23 types_hash_max_size 2048;
Filip Pytlound8986a62016-02-17 17:47:37 +010024 server_tokens {% if server.get('tokens', False) %}on{% else %}off{% endif %};
Filip Pytloun6b5bb652015-10-06 16:28:32 +020025
26 server_names_hash_bucket_size 128;
27 # server_name_in_redirect off;
28
Michel Nederlofeb5dd232018-03-13 13:57:34 +010029 variables_hash_bucket_size {{server.get('variables_hash_bucket_size', '128') }};
30
Filip Pytloun6b5bb652015-10-06 16:28:32 +020031 include /etc/nginx/mime.types;
32 default_type application/octet-stream;
33
34 ##
35 # Logging Settings
36 ##
37
Bruno Binetd63beda2018-05-22 11:40:51 +020038 access_log {{ server.get('log', {}).get('access', server.log_dir + '/access.log') }};
39 error_log {{ server.get('log', {}).get('error', server.log_dir + '/error.log') }};
Filip Pytloun6b5bb652015-10-06 16:28:32 +020040
41 ##
42 # Gzip Settings
43 ##
44
45 gzip on;
46 gzip_disable "msie6";
47
48 # gzip_vary on;
49 # gzip_proxied any;
50 # gzip_comp_level 6;
51 # gzip_buffers 16 8k;
52 # gzip_http_version 1.1;
53 # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
54
55 ##
56 # nginx-naxsi config
57 ##
58 # Uncomment it if you installed nginx-naxsi
59 ##
60
61 #include /etc/nginx/naxsi_core.rules;
62
63 ##
64 # nginx-passenger config
65 ##
66 # Uncomment it if you installed nginx-passenger
67 ##
68
69 #passenger_root /usr;
70 #passenger_ruby /usr/bin/ruby;
71
Dmitry Stremkovskiy52145c62017-08-21 23:42:17 +030072{% if server.upstream is defined %}
Bruno Binet1432e872018-05-22 10:55:32 +020073 ## Upstreams
74 include /etc/nginx/upstream.conf;
Dmitry Stremkovskiy52145c62017-08-21 23:42:17 +030075{% endif %}
76
Filip Pytloun6b5bb652015-10-06 16:28:32 +020077 ##
78 # Virtual Host Configs
79 ##
80
81 include /etc/nginx/conf.d/*.conf;
Filip Pytlound8986a62016-02-17 17:47:37 +010082 include /etc/nginx/sites-enabled/*.conf;
Filip Pytloun6b5bb652015-10-06 16:28:32 +020083}
84
Dmitry Stremkovskiy6484afa2017-08-22 17:07:06 +030085{% if server.stream is defined %}
86## Streams
87include /etc/nginx/stream.conf;
88{% endif %}
Filip Pytloun6b5bb652015-10-06 16:28:32 +020089
90#mail {
91# # See sample authentication script at:
92# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
93#
94# # auth_http localhost/auth.php;
95# # pop3_capabilities "TOP" "USER";
96# # imap_capabilities "IMAP4rev1" "UIDPLUS";
97#
98# server {
99# listen localhost:110;
100# protocol pop3;
101# proxy on;
102# }
103#
104# server {
105# listen localhost:143;
106# protocol imap;
107# proxy on;
108# }
109#}