-
Notifications
You must be signed in to change notification settings - Fork 4
/
proxy.conf
43 lines (36 loc) · 1.04 KB
/
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
# Wildcard SSL certificates;
ssl_certificate /etc/ssl/host.pem;
ssl_certificate_key /etc/ssl/host.key;
# Redirect HTTP to HTTPS;
server {
server_name _;
return 301 https://$host$request_uri;
}
# The PROXY;
server {
# HTTP authentication backend;
set $auth_backend "http://10.10.1.176:4567";
listen 443 ssl;
server_name _;
# Proxy all the request to the backend;
location / {
proxy_cache off;
proxy_pass $auth_backend;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# The backend redirects the request to /reproxy;
location /reproxy {
# make this location internal-use only;
internal;
# set DNS;
resolver 10.0.3.1;
# set $reproxy variable to the value of X-Reproxy-URL header;
set $reproxy $upstream_http_x_reproxy_url;
# proxy request to the received X-Reproxy-URL value;
proxy_pass $reproxy;
}
}