forked from georgyo/ifconfig.io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
apache.http.conf
23 lines (19 loc) · 1.01 KB
/
apache.http.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Proxy to localhost port 8081, so the go binary only has to listen on localhost:8081
ProxyPass "/" "http://127.0.0.1:8081/"
ProxyPassReverse "/" "http://127.0.0.1:8081/"
ProxyPreserveHost On
ProxyAddHeaders Off
#header for real ip
#If you don't use mod_ssl, replace %{REMOTE_ADDR}s with %{REMOTE_ADDR}e
RequestHeader set CF-Connecting-IP %{REMOTE_ADDR}s
#header for real remote port
#for an unknown reason, we can't directly use %{REMOTE_PORT}e nor %{REMOTE_PORT}s in header module, but it is working with a rewriterule
RewriteEngine on
RewriteRule .* - [E=REMOTE_PORT:%{REMOTE_PORT},NE]
RequestHeader set CF-Connecting-PORT %{REMOTE_PORT}e
#header for real Connection header (note that HTTP_CONNECTION variable does not exist anymore in apache)
#If you don't use mod_ssl, replace %{HTTP:Connection}s with %{HTTP:Connection}e
RequestHeader set CF-Connection %{HTTP:Connection}s
#header for real protocol
#If you don't use mod_ssl, replace %{SERVER_PROTOCOL}s with %{SERVER_PROTOCOL}e
RequestHeader set CF-Protocol %{SERVER_PROTOCOL}s