consolidating based on subdomains

This commit is contained in:
talksik
2023-08-14 14:43:49 -07:00
parent 3276b433b0
commit 6ffd490104
2 changed files with 48 additions and 33 deletions
+3 -8
View File
@@ -7,15 +7,10 @@ services:
restart: unless-stopped restart: unless-stopped
container_name: nginx-reverse-proxy container_name: nginx-reverse-proxy
ports: ports:
- 8080:8080 # hello world nginx docker container itself - 80:80
- 5000:5000 # container registry with tls within docker - 443:443
# rancher # kubernetes
- 2000:2000
- 2001:2001
- 80:80 # hello world in kubernetes cluster
- 3080:3080 # api within kubernetes cluster
- 6000:6000 # audio route - 6000:6000 # audio route
- 6001:6001 # video route - 6001:6001 # video route
- 6002:6002 # presence route - 6002:6002 # presence route
+45 -25
View File
@@ -1,10 +1,25 @@
# nginx.conf for a basic web server user nginx;
events {} worker_processes auto;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http { http {
# TODO: route to proper location based on subdomain
server { server {
listen 8080; listen 80;
server_name localhost; server_name flowy.live;
location / {
root /usr/share/nginx/html;
index index.html;
}
}
server {
listen 443;
server_name flowy.live;
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
@@ -12,9 +27,23 @@ http {
} }
} }
# container registry
server { server {
listen 5000; listen 80;
server_name registry.flowy.live;
location / {
proxy_pass http://registry:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 443;
server_name registry.flowy.live;
# TODO: add tls termination at nginx level
location / { location / {
proxy_pass http://registry:5000; proxy_pass http://registry:5000;
@@ -25,9 +54,9 @@ http {
} }
} }
# rancher http
server { server {
listen 2000; listen 80;
server_name rancher.flowy.live;
location / { location / {
proxy_pass http://rancher:80; proxy_pass http://rancher:80;
@@ -37,32 +66,23 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
} }
# kubernetes cluster hello world
server {
listen 80;
location / {
proxy_pass http://localhost:33360; # TODO: change to NodePort of helloworld within kubernetes
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
} }
stream { stream {
# rancher https: passthrough ssl # rancher https: passthrough ssl
server { server {
listen 2001; listen 443;
server_name rancher.flowy.live;
proxy_pass rancher:443; proxy_pass rancher:443;
} }
# kubernetes cluster api # k8s api: passthrough grpc/tcp
server { server {
listen 3080; listen 80;
proxy_pass localhost:33360; # TODO: change to NodePort of api within kubernetes server_name api.flowy.live;
proxy_pass localhost:33606;
} }
# k8s audio relay # k8s audio relay