Examples - Fluid Topics - Latest

How to Integrate Fluid Topics Via a Proxy Server

Category
Technical Notes
Audience
public
Version
Latest

In this example, a Fluid Topics customer, named Dronelift, hosts its company website at https://www.dronelift.net/. Additionally, their documentation portal is currently accessible at https://docs.dronelift.net/.

Dronelift plans to implement a proxy server, available at https://proxy.dronelift.net/, to streamline access. The documentation portal should be accessible via https://proxy.dronelift.net/docs.

The proxy definition is as follows:

  • https://proxy.dronelift.net/ to https://www.dronelift.net/ (the company website)
  • https://proxy.dronelift.net/docs to https://docs.dronelift.net/ (the documentation portal)

The examples below describe the virtual host configuration (for example, a file named proxy_dronelift_net.conf) for Apache and Nginx servers.

<VirtualHost *:443>
    ServerName proxy.dronelift.net

    SSLEngine on
    SSLCertificateFile "/path/to/cert.pem"
    SSLCertificateKeyFile "/path/to/key.pem"

    SSLProxyEngine on

    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Host "proxy.dronelift.net"

    <Location "/">
        ProxyPass "https://www.dronelift.net/"
        ProxyPassReverse "https://www.dronelift.net/"
    </Location>

    <Location "/docs">
        ProxyPass "https://docs.dronelift.net/"
        ProxyPassReverse "https://docs.dronelift.net/"

        RequestHeader set FT-Forwarded-Path "/docs"
    </Location>
</VirtualHost>
server {
    listen 443 ssl;
    ssl_certificate     cert.pem;
    ssl_certificate_key cert_key.key;

    server_name proxy.dronelift.net;

    location / {
        proxy_pass https://www.dronelift.net/;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host proxy.dronelift.net;
    }

    location /docs {
        proxy_pass https://docs.dronelift.net/;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host proxy.dronelift.net;

        proxy_set_header FT-Forwarded-Path /docs;
    }
}

The video below shows a live example of the Apache proxy configuration presented above.

It displays the following actions:

  1. Direct access to the Dronelift website.

  2. Direct access to the Dronelift documentation portal.

  3. Access to the Dronelift website via a proxy server.

  4. Access to the Dronelift documentation portal via a proxy server.