Using Nginx as a Simple HTTP Reverse Proxy

Nginx is a commonly used web server and reverse proxy available at http://nginx.org/.

To use Nginx as a reverse proxy for the Controller, simply include the Controller as the upstream server in the Nginx configuration. If deploying two Controllers in a high availability pair arrangement, include the addresses of both the primary and secondary Controllers in the upstream server definition.

The following steps walk you through the set up at a high level. It assumes you have already installed the Controller and have an Nginx instance, and you only need to modify the existing configuration to have Nginx route traffic to the Controller.

To route Controller traffic through an Nginx reverse proxy
  1. Add a JVM option named-Dappdynamics.controller.ui.deeplink.url . Set its value to the URL for the Controller, as described in the guidelines above.

  2. Shut down the Controller.

  3. If terminating SSL at the proxy, also set the-Dappdynamics.controller.services.hostName and -Dappdynamics.controller.services.port JVM options to the external DNS hostname for the Controller and the external port number, typically 443.

  4. In the Nginx home directory on the reverse proxy machine, open theconf/nginx.conf file for editing.

  5. In the configuration file, add a cluster definition the specifies each Controller as an upstream server. For example:In the sample, the Controller resides on 127.0.15.11 and has the fully qualified domain name appdcontroller.example.com
    upstream appdcontroller {
    server 127.0.15.11:8090 fail_timeout=0;
    }
    server {
    listen 80;
    server_name appdcontroller.example.com;
    expires 0;
    add_header Cache-Control private;
    location / {
    proxy_set_header    Host $host;
    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Forwarded-Proto https;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass          http://appdcontroller;
    }
    }
  6. Restart the Nginx server to have the change take effect.

  7. Restart the Controller.

After the Controller starts, it should be able to receive traffic through Nginx. As an initial test of the connection, try opening the Controller UI via the proxy, that is, in a browser, go to http://<virtualip>:80/controller

After the Controller starts, it should be able to receive traffic through Nginx. As an initial test of the connection, try opening the Controller UI via the proxy, that is, in a browser, go to http://<virtualip>:80/controller general guidelines above.