The point of tunneling is to serve one of your local port (here localhost:5000
) on a url (such as random.yourdomain.com
)
If you want to mimic the behavior of you app when accessed from the outside
Advantage : easy Draw back : not accessible form the outside
The instructions here are written for a macOS 10.13.3
- Download nginx
brew install nginx
To stop nginx, run
nginx -s stop
- Configure nginx
server {
listen 80;
server_name anna.anna-livia.com;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
- Open your browser to localhost:80
- Open /etc/hosts
sudo vim etc/hosts
- Add the domain
127.0.0.1 random.yourdomain.com
- Access
random.yourdomain.com
from your browser