Forwarding HTTPS to VM's HTTPS...
Kevin "Ingwie Phoenix" Ingwersen
ingwie2000 at googlemail.com
Tue Feb 16 06:47:58 UTC 2016
StackOverflow didn’t do anything this time, so I decided to visit here and try asking my question here! :)
A bit of backstory:
I have had a fatal server crash. 464 days of uptime with unapplied updates from an OS upgrade, kernel patches and more. When I did do a reboot…it all exploded right into my face :( So I reinstalled.
Now that I have learned this lesson, I decided to begin deploying things in containers - just raw Virtual Box VMs now, as I haven’t gotten used to Docker or Vagrant. But using a VM with NAT allows me to forward ports.
One of the VMs is your typical web-server setup; MySQL, PHP5 (FPM) and Nginx (1.8.x). So I have my main server - the VM host - listening on 80 and 443 and forwarded the VM’s ports as 11080 and 11443. Forwarding regular HTTP works flawlessly by just proxy_pass’ing to the other port. No problem here.
But how do I work out a reverse-proxy for HTTPS traffic? Mainly, I have another VM that runs OwnCloud. I want to forward my host’s 443 port to the VM’s exposed 12443 port so that OwnCloud stops complaining about being opened via raw HTTP.
Since I am re-using configuration a lot, I have created a basic_proxy file, and a regular sites-enabled/ file. You can see them here: https://gist.github.com/IngwiePhoenix/19631bd07af62d23b8f3 <https://gist.github.com/IngwiePhoenix/19631bd07af62d23b8f3> <https://gist.github.com/IngwiePhoenix/19631bd07af62d23b8f3 <https://gist.github.com/IngwiePhoenix/19631bd07af62d23b8f3>>
Would be cool if I could keep with this approach to simply forward traffic to my various VMs, but keeping my config reusable!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx