-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf.template
45 lines (35 loc) · 1.44 KB
/
nginx.conf.template
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
worker_processes auto;
events {
# Устанавливаем максимальное кол-во соединений для одного рабочего процесса
worker_connections 8000;
# Указывем nginx, чтобы он пытался принять максимльное кол-во подключений
multi_accept on;
}
http {
# Указываем корректные заголовки для всех типов расширений
include mime.types;
default_type application/octet-stream;
# Увеличиваем производительность
sendfile on;
# Сжимаем данные
gzip on;
gzip_comp_level 6;
gzip_min_length 100;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
server {
index index.html index.htm;
# Слушаем порт
listen ${APP_PORT};
# Директория из которой раздаем статику
root /usr/share/nginx/html;
# Сначала пытаемся обработать запрос как к файлу или директории
location / {
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}