Skip to content

Commit

Permalink
Merge pull request #5 from theohbrothers/enhancement/make-resolver-op…
Browse files Browse the repository at this point in the history
…tional

Enhancement: Make `RESOLVER` optional
  • Loading branch information
leojonathanoh committed Dec 5, 2023
2 parents e368538 + 5750ceb commit 792109b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 12 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![github-release](https://img.shields.io/github/v/release/theohbrothers/docker-nginx-forward-proxy?style=flat-square)](https://github.com/theohbrothers/docker-nginx-forward-proxy/releases/)
[![docker-image-size](https://img.shields.io/docker/image-size/theohbrothers/docker-nginx-forward-proxy/latest)](https://hub.docker.com/r/theohbrothers/docker-nginx-forward-proxy)

The `nginx-foward-proxy` is a so simple HTTP proxy server using the nginx, using [`ngx_http_proxy_connect_module`](https://github.com/chobits/ngx_http_proxy_connect_module).
The `nginx-forward-proxy` is a so simple HTTP proxy server using the nginx, using [`ngx_http_proxy_connect_module`](https://github.com/chobits/ngx_http_proxy_connect_module).

You can easily build a HTTP proxy server using this.

Expand All @@ -16,13 +16,17 @@ You can easily build a HTTP proxy server using this.
| `:1.24.0` | [View](variants/1.24.0) |
| `:1.23.4` | [View](variants/1.23.4) |


## Usage

```sh
docker run --rm -it -p 3128:3128 theohbrothers/docker-nginx-forward-proxy:latest

# Test it
curl -x http://127.0.0.1:3128 http://example.com
curl -x http://127.0.0.1:3128 https://example.com
# Or
http_proxy=http://127.0.0.1:3128 curl http://example.com
HTTPS_PROXY=http://127.0.0.1:3128 curl https://example.com
```

### Environment variables
Expand Down
8 changes: 6 additions & 2 deletions generate/templates/README.md.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![github-release](https://img.shields.io/github/v/release/theohbrothers/docker-nginx-forward-proxy?style=flat-square)](https://github.com/theohbrothers/docker-nginx-forward-proxy/releases/)
[![docker-image-size](https://img.shields.io/docker/image-size/theohbrothers/docker-nginx-forward-proxy/latest)](https://hub.docker.com/r/theohbrothers/docker-nginx-forward-proxy)
The ``nginx-foward-proxy`` is a so simple HTTP proxy server using the nginx, using [``ngx_http_proxy_connect_module``](https://github.com/chobits/ngx_http_proxy_connect_module).
The ``nginx-forward-proxy`` is a so simple HTTP proxy server using the nginx, using [``ngx_http_proxy_connect_module``](https://github.com/chobits/ngx_http_proxy_connect_module).
You can easily build a HTTP proxy server using this.
Expand All @@ -32,13 +32,17 @@ $(
"@

@'
## Usage
```sh
docker run --rm -it -p 3128:3128 theohbrothers/docker-nginx-forward-proxy:latest
# Test it
curl -x http://127.0.0.1:3128 http://example.com
curl -x http://127.0.0.1:3128 https://example.com
# Or
http_proxy=http://127.0.0.1:3128 curl http://example.com
HTTPS_PROXY=http://127.0.0.1:3128 curl https://example.com
```
### Environment variables
Expand Down
2 changes: 1 addition & 1 deletion generate/templates/docker-entrypoint.sh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#!/bin/sh
set -eu
RESOLVER=${RESOLVER:-1.1.1.1 ipv6=off}
RESOLVER=${RESOLVER:-}
if [ -n "$RESOLVER" ]; then
echo "Applying: resolver $RESOLVER;"
sed -i "s/# resolver.*/resolver $RESOLVER;/" /usr/local/nginx/conf/nginx.conf
Expand Down
2 changes: 1 addition & 1 deletion generate/templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http {
access_log /dev/stdout;
error_log /dev/stderr;

# resolver 1.1.1.1 ipv6=off;
resolver 1.1.1.1 ipv6=off;

proxy_connect;
proxy_connect_allow 443 563;
Expand Down
2 changes: 1 addition & 1 deletion variants/1.23.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu

RESOLVER=${RESOLVER:-1.1.1.1 ipv6=off}
RESOLVER=${RESOLVER:-}
if [ -n "$RESOLVER" ]; then
echo "Applying: resolver $RESOLVER;"
sed -i "s/# resolver.*/resolver $RESOLVER;/" /usr/local/nginx/conf/nginx.conf
Expand Down
2 changes: 1 addition & 1 deletion variants/1.23.4/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http {
access_log /dev/stdout;
error_log /dev/stderr;

# resolver 1.1.1.1 ipv6=off;
resolver 1.1.1.1 ipv6=off;

proxy_connect;
proxy_connect_allow 443 563;
Expand Down
2 changes: 1 addition & 1 deletion variants/1.24.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu

RESOLVER=${RESOLVER:-1.1.1.1 ipv6=off}
RESOLVER=${RESOLVER:-}
if [ -n "$RESOLVER" ]; then
echo "Applying: resolver $RESOLVER;"
sed -i "s/# resolver.*/resolver $RESOLVER;/" /usr/local/nginx/conf/nginx.conf
Expand Down
2 changes: 1 addition & 1 deletion variants/1.24.0/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http {
access_log /dev/stdout;
error_log /dev/stderr;

# resolver 1.1.1.1 ipv6=off;
resolver 1.1.1.1 ipv6=off;

proxy_connect;
proxy_connect_allow 443 563;
Expand Down
2 changes: 1 addition & 1 deletion variants/1.25.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu

RESOLVER=${RESOLVER:-1.1.1.1 ipv6=off}
RESOLVER=${RESOLVER:-}
if [ -n "$RESOLVER" ]; then
echo "Applying: resolver $RESOLVER;"
sed -i "s/# resolver.*/resolver $RESOLVER;/" /usr/local/nginx/conf/nginx.conf
Expand Down
2 changes: 1 addition & 1 deletion variants/1.25.3/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http {
access_log /dev/stdout;
error_log /dev/stderr;

# resolver 1.1.1.1 ipv6=off;
resolver 1.1.1.1 ipv6=off;

proxy_connect;
proxy_connect_allow 443 563;
Expand Down

0 comments on commit 792109b

Please sign in to comment.