1
0
Fork 0

adding basics

This commit is contained in:
Colin 2023-09-25 12:46:39 -04:00
commit 93ddb5096b
3 changed files with 49 additions and 0 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
# Start from the official Nginx image
FROM nginx:alpine
# Copy our custom Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.9'
services:
nginx-proxy:
build:
context: .
dockerfile: Dockerfile
image: codeberg.org/Iridium-net/lan-to-nginx:latest
environment:
- BACKEND_ADDRESS=192.168.8.1 # Replace with your backend address
- BACKEND_PORT=80 # Replace with your backend port
ports:
- "80:80" # Map port 80 from the host to port 80 in the container

28
nginx.conf Normal file
View File

@ -0,0 +1,28 @@
user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load environment variables
env BACKEND_ADDRESS;
env BACKEND_PORT;
server {
listen 80;
location / {
# Use the environment variables for the proxy pass
proxy_pass http://$BACKEND_ADDRESS:$BACKEND_PORT;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}