adding basics
This commit is contained in:
commit
93ddb5096b
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue