Friday, November 30, 2018

How to setup your VMWare Fusion to use static IP addresses on Mac OSX

1. Set a Static IP for your virtual machine system.
sudo vim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf

After where it says End of “DO NOT MODIFY SECTION” enter the following lines:
host Windows8x64 {
    hardware ethernet 00:0C:29:B6:22:3E;
    fixed-address 172.16.106.128;
}

2. Change NAT configure file.
sudo vi /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf

Add your configure, for example:
[incomingtcp]
# Use these with care — anyone can enter into your VM through these…
# The format and example are as follows:
#8080 = 172.16.3.128:80
80 = 172.16.106.128:80

3. Restart network service of VMware Fusion.
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start


Reference: https://medium.com/@tuweizhong/how-to-setup-port-forward-at-vmware-fusion-8-for-os-x-742ad6ca1344

Saturday, February 3, 2018

Nginx - Reverse Proxy

Proxy server

server {
    listen       80;
    server_name  proxy.com;

    location / {
        auth_basic "Restricted Content";
        auth_basic_user_file /etc/nginx/.htpasswd;
        proxy_pass https://destination.com;
    }
}

Load balancing

http {
    upstream myapp1 {
        server srv1.example.com;
        server srv2.example.com;
        server srv3.example.com;
    }

    server {
        listen 80;

        location / {
            proxy_pass http://myapp1;
        }
    }
}