Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
stianst committed Feb 22, 2023
1 parent 2a50b21 commit cacdcba
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kc-production/nginx-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
FROM docker.io/nginx
COPY default.conf /etc/nginx/conf.d/default.conf

ARG conf_file
COPY $conf_file /etc/nginx/conf.d/default.conf
1 change: 1 addition & 0 deletions kc-production/nginx-proxy/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
upstream localhost {
server localhost:8080;
server localhost:8081;
}

server {
Expand Down
13 changes: 13 additions & 0 deletions kc-production/nginx-proxy/hostname-basic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
upstream mycluster {
server localhost:8080;
}

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;

location / {
proxy_pass http://mycluster/;
}
}
15 changes: 15 additions & 0 deletions kc-production/nginx-proxy/hostname-xheaders.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
upstream mycluster {
server localhost:8080;
}

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;

location / {
proxy_pass http://mycluster/;
proxy_set_header X-Forwarded-For "localhost";
proxy_set_header X-Forwarded-Proto "http";
}
}
11 changes: 9 additions & 2 deletions kc-production/nginx-proxy/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@

cd $(readlink -f $0 | xargs dirname)

sudo podman build -t example-proxy .
sudo podman run --network=host example-proxy
CONF_FILE=$1

if [ "$1" == "" ] || [ ! -f "$1" ]; then
echo "usage: start.sh <conf_file>"
exit 1
fi

sudo podman build --build-arg conf_file=$CONF_FILE -t example-proxy .
sudo podman run --network=host example-proxy

0 comments on commit cacdcba

Please sign in to comment.