-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
53 lines (37 loc) · 1.17 KB
/
default.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
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_cache all;
proxy_cache_valid 404 502 503 1m;
proxy_cache_valid any 1h;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires max; root /var/www/html/apache;}
}
server {
listen 443 ssl http2;
server_name nginxtestsite.ru;
ssl_certificate /etc/nginx/ssl/example.pem;
ssl_certificate_key /etc/nginx/ssl/example.key;
root /var/www/html;
index index.nginx-debian.html;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
#proxy_cache all;
#proxy_cache_valid 404 502 503 1m;
#proxy_cache_valid any 1h;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires max; root /var/www/html/apache;}
}
upstream backend {
server 127.0.0.1:8080 weight=10;
server 192.168.222.121:8080 weight=5;
}