-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
# http_echo_ip | ||
一个只会输出IP的http服务,配合DDNS使用 | ||
|
||
参数 | ||
``` | ||
-l, --listen <LISTEN> 监听地址 [default: 127.0.0.1] | ||
-p, --port <PORT> 监听端口号 [default: 80] | ||
``` | ||
cli: `http_echo_ip -l 127.0.0.1 -p 23343` | ||
|
||
docker: `docker run --name echo_ip -d --restart always --network host evlan/http_echo_ip -l 127.0.0.1 -p 23343` | ||
|
||
配合nginx反代 | ||
``` | ||
location = /ip { | ||
proxy_pass http://127.0.0.1:23343; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
} | ||
``` |