-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
103 lines (79 loc) · 3.24 KB
/
nginx.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# disabilito per riabilitarlo, col ns formato, a livello di server
access_log off;
log_format custom '$upstream_cache_status $http_x_forwarded_for "$request" $status $body_bytes_sent "$http_referer"' ;
proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=mipcache:1m max_size=100m inactive=60d use_temp_path=off;
server {
access_log /var/log/nginx/access.log custom;
# force dns resolution
resolver 8.8.8.8;
charset utf-8;
root /usr/share/nginx/html;
gzip on;
gzip_types text/css text/javascript application/javascript application/json;
gzip_min_length 500;
proxy_http_version 1.1; # il default è ancora 1.0
proxy_ignore_headers Cache-Control;
# proxy_cache_valid 200 180d;
proxy_cache_lock on;
proxy_cache_use_stale updating;
proxy_cache_background_update on;
# le richieste con http header recache bypassano la cache (il poller fa così), un "wormer" o un "bucante" deve impostare questo header
proxy_cache_bypass $http_recache;
location / {
try_files $uri /index.html;
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
add_header Cache-Control "public";
}
# Media: images, icons, video,
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4)$ {
expires 1M;
add_header Cache-Control "public";
}
### REVERSE PROXY ###
location /news {
# proxy_pass https://reporter.5t.torino.it/ws/publish.php?ch=11; # reporter di produzione registry:5000/mip-port
# proxy_pass http://test.5t.torino.it:86/ws/publish.php?ch=11; # reporter di test registry:5000/mip-port:test
proxy_pass ${REPORTER_URL};
# proxy_cache mipcache;
}
location /notiziario/notiziario.mp3 {
expires off;
proxy_pass https://s3-eu-west-1.amazonaws.com/5t.mip.notiziario/notiziario.mp3;
}
# url comunicata alle radio
location /notiziario-traffico-piemonte.mp3 {
proxy_pass https://s3-eu-west-1.amazonaws.com/5t.mip.notiziario/notiziario.mp3;
}
location /wp-json/ {
proxy_pass http://wpmip.5t.torino.it/wp-json/;
}
location ^~ /wp-images/ {
proxy_pass http://wpmip.5t.torino.it/wp-content/uploads/;
}
location = /meteoarpa {
set $backendArpa "https://i0b1qnp3za.execute-api.eu-west-1.amazonaws.com/prod/getForecast";
proxy_ssl_server_name on; #passing of the server name
proxy_pass $backendArpa;
proxy_cache mipcache;
proxy_cache_valid 30m;
}
location = /voli-caselle {
# proxy_pass https://pwfo8ijf7h.execute-api.eu-west-1.amazonaws.com/default/mipCaselleScrape;
set $backend "https://pwfo8ijf7h.execute-api.eu-west-1.amazonaws.com/default/mipCaselleScrape";
proxy_pass $backend;
proxy_cache mipcache;
proxy_cache_valid 2m;
}
location /colli {
# proxy_pass http://colli/api/index.php; # PRODUZIONE , uso nome del servizio
# proxy_pass http://swarm.5t.torino.it:90/api/index.php; # TEST , uso endpoint di rete
proxy_pass ${COLLI_URL};
}
location /suggest {
proxy_pass http://geocoding-dns.5t.torino.it:8082/suggest;
proxy_set_header Referer ''; # altrimenti becchiamo 403 forbidden da unicorn ??!!
}
}