Skip to content

Instantly share code, notes, and snippets.

@pentateu
Last active April 13, 2020 09:41
Show Gist options
  • Save pentateu/f9dc675f9154e09c4ca86202c70e9308 to your computer and use it in GitHub Desktop.
Save pentateu/f9dc675f9154e09c4ca86202c70e9308 to your computer and use it in GitHub Desktop.
on ubuntu host machine open ports on firewall
# in this case the subnet is 10.1.1.x
#docker daemon
sudo ufw allow from 10.1.1.0/8 to any port 2376 proto tcp
# Nats
sudo ufw allow from 10.1.1.0/8 to any port 4222 proto tcp
sudo ufw allow from 10.1.1.0/8 to any port 5775 proto udp
# mongo
sudo ufw allow from 10.1.1.0/8 to any port 27017 proto tcp
sudo ufw allow from 10.1.1.0/8 to any port 6831 proto udp
sudo ufw allow from 10.1.1.0/8 to any port 6832 proto udp
sudo ufw allow from 10.1.1.0/8 to any port 5778 proto tcp
# install nginx on mac
brew install nginx
# update /usr/local/etc/nginx/nginx.conf with the contents below
worker_processes 1;
# reverse proxy mapping
stream {
#NATS
server {
listen 4222;
proxy_pass ubuntu.local:4222;
}
# Elastic
server {
listen 9200;
proxy_pass ubuntu.local:9200;
}
#Mongo
server {
listen 27017;
proxy_pass ubuntu.local:27017;
}
#Jaeger Agent
server {
listen 5775 udp;
proxy_pass ubuntu.local:5775;
}
server {
listen 6831 udp;
proxy_pass ubuntu.local:6831;
}
server {
listen 6832 udp;
proxy_pass ubuntu.local:6832;
}
server {
listen 5778;
proxy_pass ubuntu.local:5778;
}
# Jaeger Collector
# TODO when testing Jaeger :)
}
events {
worker_connections 1024;
}
# webserver
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 8088;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include servers/*;
}
#restart
brew services restart nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment