This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pachube_proxy.conf
66 lines (58 loc) · 1.67 KB
/
pachube_proxy.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
user nginx nginx; worker_processes 3;
error_log log/nginx/pachube-api.error_log debug;
events {
worker_connections 1024;
use epoll;
}
http {
upstream pachube-ssl-proxy {
server 173.203.98.29:443;
}
server {
# curl https://api.pachube.com/v1/feeds/504.csv
# curl -6 http://localhost:81/feeds/504.csv
listen [::0]:81;
location / {
proxy_set_header host api.pachube.com;
proxy_set_header X-PachubeApiKey COPY_YOUR_TOP_SECRET_STRING_OF_43_CHARCTERS;
proxy_hide_header Age;
proxy_hide_header Vary;
proxy_hide_header Last-Modified;
proxy_hide_header X-Pachube-Logging-Key;
proxy_hide_header X-PachubeRequestId;
proxy_hide_header Cache-Control;
proxy_pass https://pachube-ssl-proxy/v1/;
}
}
server {
# curl https://api.pachube.com/v2/feeds/504.csv
# curl -6 http://localhost:82/feeds/504.csv
listen [::0]:82;
location / {
proxy_set_header host api.pachube.com;
proxy_set_header X-PachubeApiKey COPY_YOUR_TOP_SECRET_STRING_OF_43_CHARCTERS;
proxy_hide_header Age;
proxy_hide_header Vary;
proxy_hide_header Last-Modified;
proxy_hide_header X-Pachube-Logging-Key;
proxy_hide_header X-PachubeRequestId;
proxy_hide_header Cache-Control;
proxy_pass https://pachube-ssl-proxy/v2/;
}
}
server {
listen [::0]:80;
location / {
proxy_set_header host pachube.com;
proxy_pass https://pachube-ssl-proxy;
}
}
server {
# curl -6 http://localhost:83/504/datastreams/0/history.csv
listen [::0]:83;
location / {
proxy_set_header host pachube.com;
proxy_pass https://pachube-ssl-proxy/feeds/;
}
}
}