-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf.orig
126 lines (101 loc) · 3.94 KB
/
nginx.conf.orig
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
worker_processes 1;
events {}
http {
include /etc/nginx/mime.types;
log_format rt_cache '$http_x_forwarded_for +@+ $remote_addr - $upstream_cache_status [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
# The official nginx image creates a symbolic link from /var/log/nginx/access.log to /dev/stdout
access_log /var/log/nginx/access.log rt_cache;
# and creates another symbolic link from /var/log/nginx/error.log to /dev/stderr
error_log /var/log/nginx/error.log;
proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=mipcache:1m max_size=100m inactive=60d use_temp_path=off;
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/css
text/javascript
application/javascript
;
server {
charset utf-8;
root /usr/share/nginx/html;
# proxy_cache mipcache;
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;
}
### 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_http_version 1.1;
# 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 {
# proxy_pass http://telegraf:3012/meteoarpa;
resolver 8.8.8.8;
set $backendArpa "https://dsml3n16i9.execute-api.eu-west-1.amazonaws.com/v1/mipArpaScrape";
# proxy_pass https://dsml3n16i9.execute-api.eu-west-1.amazonaws.com/v1/mipArpaScrape;
proxy_cache mipcache;
proxy_pass $backendArpa;
proxy_cache_valid 30m;
}
location = /voli-caselle {
# force dns resolution
resolver 8.8.8.8;
# 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_http_version 1.1;
proxy_cache mipcache;
proxy_cache_valid 2m;
}
location /colli {
# proxy_pass http://lab.5t.torino.it/mip-colli/api/;
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
}
location /suggest {
proxy_pass http://geocoding-dns.5t.torino.it:8082/suggest;
proxy_set_header Referer ''; # altrimenti becchiamo 403 forbidden da unicorn ??!!
}
location /ottieni/ {
proxy_pass http://swarm.5t.torino.it:3071/ottieni/;
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
#access_log off;
add_header Cache-Control "public";
}
# Media: images, icons, video,
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4)$ {
expires 1M;
# access_log off;
add_header Cache-Control "public";
}
}
}