My g3proxy http_rproxy example using docker containers #493
Replies: 6 comments 12 replies
-
You need to use https://github.com/bytedance/g3/blob/master/g3proxy/examples/simple_http_gateway/g3proxy.yaml this as an example HTTP reverse proxy config. The You need to mount your g3proxy.yaml config file or config dir when start the docker container, and change the entry command to |
Beta Was this translation helpful? Give feedback.
-
The g3proxy container has a http_proxy server, which is a forward proxy mode server, you can test it with I think you need to expose the ports in g3proxy container to the host, so you can run it from the host. I will try this when I have some free time. |
Beta Was this translation helpful? Give feedback.
-
I believe I got it using This configuration is likely not compose.yml
my_g3proxy.yml
docker ps
curl who.landingdev.xyz:8080client same as host
remote client
docker compose up
files
|
Beta Was this translation helpful? Give feedback.
-
I have my
I haven't tried removing I can also probably remove the dedicated IPs also
This still doesn't feel *PS: sorry for commenting on this closed thread compose.yml
my_g3proxy.yml
docker compose up
curl who.landingdev.xyz:8080
|
Beta Was this translation helpful? Give feedback.
-
Ok, this I think the whole time I only needed to include whatever was my docker named network compose.ymlnetworks:
g3w-net:
services:
g3proxy_w:
image: g3proxy/comp:g3
build:
context: ./g3
dockerfile: g3proxy/docker/debian.Dockerfile
networks:
- g3w-net
ports:
- "8080:8080"
volumes:
- .:/g3/
command:
-c /g3/my_g3proxy.yml
who:
image: traefik/whoami
hostname: who # <-- this also can be removed, leaving for logging
container_name: who.internal # <-- this also can be removed
networks:
- g3w-net my_g3proxy.ymllog: stdout
resolver:
- name: default
type: c-ares
server:
- 127.0.0.11
escaper:
- name: default
type: direct_fixed
resolve_strategy: IPv4Only
resolver: default
server:
- name: g3proxy
escaper: default
type: http_rproxy
listen:
address: 0.0.0.0:8080
hosts:
- exact_match: who.landingdev.xyz
# upstream: who:80 #<-- also works
upstream: who.internal:80 curl who.landingdev.xyz:8080
docker compose up
|
Beta Was this translation helpful? Give feedback.
-
Works! and is I did a complete prune of docker, including the buildx cache. And I restarted twice to confirm Everything still works, just an anomalous entry in the log file type I get this in my
Files
compose.ymlservices:
g3proxy_w:
image: g3proxy/comp:g3
build:
context: ./g3
dockerfile: g3proxy/docker/debian.Dockerfile
ports:
- "8080:8080"
volumes:
- .:/g3/
command:
-c /g3/my_g3proxy.yml
who:
image: traefik/whoami
hostname: who
container_name: who.internal my_g3proxy.ymllog: stdout
resolver:
- name: default
type: c-ares
escaper:
- name: default
type: direct_fixed
resolve_strategy: IPv4Only
resolver: default
server:
- name: g3proxy
escaper: default
type: http_rproxy
listen:
address: 0.0.0.0:8080
hosts:
- exact_match: who.landingdev.xyz
# upstream: who:80
upstream: who.internal:80 docker ps
docker compose up
curl who.landingdev.xyz:8080
|
Beta Was this translation helpful? Give feedback.
-
How do I make a reverse proxy with g3?
Your documentation is very good but my cave man literacy level is lower than any other recorded caveman.
I understand some caveman technology and I can often make other rocks that cavemen use work. I usually see how the other cavemen smash rocks and then repeat their rock smashing actions with my own rocks.
But these rocks look a little different than what this caveman encountered seeing other caveman use and is not getting an immediate fire in his cave.
How do I smash these rocks together to make a reverse proxy?
Caveman first procured the rocks like so.
And this Caveman then sees that his rocks are indeed in his cave now.
Caveman then poked the rock and not smash the rock yet to verify it is a working rock.
Caveman now wants to use his rock on his VPS I mean Cave to point from the entrance of his cave to another
special rock in his cave whenever someone enters his Cave.
Caveman is not good with "words" and wants to see rocks!
I think this is the cave pit that I need to use for the "whoami" reverse-proxy
Beta Was this translation helpful? Give feedback.
All reactions