Skip to content

Instantly share code, notes, and snippets.

@SanthoshBabuMR
Last active May 5, 2020 02:02
Show Gist options
  • Save SanthoshBabuMR/4e241a93a69668cda0cc10910f817cee to your computer and use it in GitHub Desktop.
Save SanthoshBabuMR/4e241a93a69668cda0cc10910f817cee to your computer and use it in GitHub Desktop.
nginx: setup reverse proxy ( Reroute all requests at port 8443 to a different IP:port )
# install nginx
apt-get update
apt-get install nginx
unlink /etc/nginx/sites-enabled/default
# configure
cat > /etc/nginx/sites-available/reverse-proxy.conf
server {
listen 8443;
location / {
proxy_pass https://192.168.99.103:8443/;
}
}
# symlink
ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf
# test and restart service
service nginx configtest
service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment