Search code examples
cloud-foundrypcf

Access to PCF app from another machine


I'm new with the PCF and trying to deploy a simple web-app. I've installed the cf CLI, pcfdev and pushed my app to pcf:

cf push test-ui -b staticfile_buildpack
...
name:              test-ui
requested state:   started
instances:         1/1
usage:             256M x 1 instances
routes:            test-ui.local.pcfdev.io
last uploaded:     Thu 23 Aug 13:09:04 +03 2018
stack:             cflinuxfs2
buildpack:         staticfile_buildpack
start command:     $HOME/boot.sh

     state     since                  cpu    memory         disk          details
#0   running   2018-08-23T10:09:17Z   0.0%   5.3M of 256M   25M of 512M

So, now, I can access my test app by link test-ui.local.pcfdev.io from the same machine where I've started my pcf instance. But I don't know how to access to this app from another device in the same network.

Could someone tell me what I should do to open my test app from another device in the same network as my local machine?


Solution

  • I've found a solution: using the reverse proxy to redirect request from my local port app's url:

    (using nginx as example):

    server {
        listen 8090;
        server_name pcf-rp;
    
        location / {
           proxy_pass http://test-ui.local.pcfdev.io;
        }
    }