1 개요
- nginx-forward-proxy
- docker run nginx-forward-proxy
Console
Copy
testuser@localhost:~$ curl -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/
curl: (7) Failed to connect to 127.0.0.1 port 3128: Connection refused
Console
Copy
testuser@localhost:~$ docker run -d --name proxy -p 3128:3128 hinata/nginx-forward-proxy:latest
242d7163b9b678f1893edeca4902364bcff70765ce24a890c8079c26abf57235
2 테스트 1
http 테스트
Console
Copy
testuser@localhost:~$ curl -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
https 테스트
Console
Copy
testuser@localhost:~$ curl -sx http://127.0.0.1:3128 https://raw.githubusercontent.com/anak10thn/WTFPL/master/LICENSE.txt | head -1
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3 테스트 2
http 테스트
Console
Copy
testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/ | head -1
HTTP/1.1 200 OK
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:33:18 +0000] "GET http://www.wtfpl.net/txt/copying/ HTTP/1.1" 200 498 "-" "curl/7.74.0" "-"
Console
Copy
testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 http://github.com/ | head -1
HTTP/1.1 301 Moved Permanently
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:30:29 +0000] "HEAD http://github.com/ HTTP/1.1" 301 0 "-" "curl/7.74.0" "-"
https 테스트
Console
Copy
testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 https://raw.githubusercontent.com/anak10thn/WTFPL/master/LICENSE.txt | head -1
HTTP/1.1 200 Connection Established
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:32:17 +0000] "CONNECT raw.githubusercontent.com:443 HTTP/1.1" 200 4982 "-" "curl/7.74.0" "-"
Console
Copy
testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 https://github.com/ | head -1
HTTP/1.1 200 Connection Established
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:31:02 +0000] "CONNECT github.com:443 HTTP/1.1" 200 6144 "-" "curl/7.74.0" "-"
4 같이 보기
5 참고
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.