First attempt at an NGINX reverse proxy skeleton.
This commit is contained in:
parent
1134bc7a1e
commit
32cecb92f6
11
Config/ReverseProxy/Dockerfile
Normal file
11
Config/ReverseProxy/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
# 2022-10-05 Hyperling
|
||||
# Move config to nginx container.
|
||||
# This is because nginx image does not play well with Volumes.
|
||||
# Nextcloud and MariaDB created files in their folders fine, but nginx stays empty.
|
||||
|
||||
FROM nginx
|
||||
|
||||
COPY ./config/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
COPY ./config/conf.d/* /etc/nginx/conf.d/
|
||||
|
2
Config/ReverseProxy/config/conf.d/test.conf
Normal file
2
Config/ReverseProxy/config/conf.d/test.conf
Normal file
@ -0,0 +1,2 @@
|
||||
# 2022-10-05 Hyperling
|
||||
# Just a dummy test file.
|
34
Config/ReverseProxy/config/nginx.conf
Normal file
34
Config/ReverseProxy/config/nginx.conf
Normal file
@ -0,0 +1,34 @@
|
||||
# 2022-10-05 Hyperling
|
||||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
|
20
Config/ReverseProxy/docker-compose.yml
Normal file
20
Config/ReverseProxy/docker-compose.yml
Normal file
@ -0,0 +1,20 @@
|
||||
# 2022-10-05 Hyperling
|
||||
# Reverse Proxy
|
||||
# This is a revised version of the original work here:
|
||||
# https://phoenixnap.com/kb/docker-nginx-reverse-proxy
|
||||
# https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/
|
||||
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: nginx
|
||||
restart: always
|
||||
# Instead of using a volume, have the config files in . and COPY them to container with DockerFile
|
||||
# volumes:
|
||||
# - /opt/Docker/Volumes/ReverseProxy/nginx:/etc/nginx/
|
||||
build: ./
|
||||
ports:
|
||||
- 8081:80
|
||||
- 8082:443
|
||||
|
Loading…
x
Reference in New Issue
Block a user