An APEX Vanity URL for Dockerized Customer Managed ORDS for Private Endpoint ADB on OCI

Matt MulvaneyMatt Mulvaney
3 min read

In this post, I'll walk through setting up a custom Vanity URL for a Dockerized, customer-managed Oracle REST Data Services (ORDS) instance connected to an Autonomous Database (ADB) on Oracle Cloud Infrastructure (OCI)

Prerequisites

You have completed the steps to create a Dockerized Customer Managed ORDS for ADB on OCI

In the steps below, we are trying to setup Nginx Proxy Manager to locate your ORDS Docker Container by FQDN. So you’ll need terminal access to run a bunch of commands until you find it.

Steps

  1. Follow this blog to install Nginx Proxy Manager in another container

  2. Once installed, configure Nginx Proxy Manager like this.

    Where it says Enter Compute FQDN, try these (in this order) until you get a method that works for you:

    1. Your FQFN hostname -f ← this worked for me
    2. Your Non-authorative IP Address nslookup $(hostname -f) | grep 'Address:' | tail -n 1
    2b. Another Method for the above grep $(hostname -f) /etc/hosts | awk '{print $1}'
    3. Your compute IP address, try the first IP in this list ifconfig | grep 'inet ' | awk '{ print $2 }'
    4. Your IP address curl ipconfig.io

  3. In SSL, select your Certificate

  4. Use this configuration in the Advanced Tab of NGINX proxy Manager

                         location /ords/ {
                             proxy_pass https://your-FQDN:9643/ords/;
                             proxy_set_header Origin "";
                             proxy_set_header X-Forwarded-Host $host:$server_port;
                             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                             proxy_set_header X-Real-IP $remote_addr;
                             proxy_set_header X-Forwarded-Proto $scheme;
                             proxy_set_header Host $host:$server_port;
    
                             # Uncomment these if needed to rewrite the redirects properly
                             # proxy_redirect https://example.com/ords/_/landing https://example.com/ords/r/wksp_x/custom-ords-landing/home;
    
                         }
    
                         location /i/ {
                             proxy_pass https://your-FQDN:9643/i/;
                             proxy_set_header X-Forwarded-Host $host;
                             proxy_set_header X-Real-IP $remote_addr;
                             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                             proxy_set_header Host $host:$server_port;
                         }
    
    • Where it says your-FQDN use the method that worked above

    • Change example.com to your Domain name

    • Its a good idea to uncomment the line above to land on a specific page

Using another proxy manager instead? try adapt the above configuration using this guide

  1. In your Cloudflare Dashboard go to DNS > Records

  2. Add a domain or subdomain to redirect to your Nginx Proxy Manager IP

  3. Test out your URL. Yours wont look like this, because I (cough\ ChatGPT*) created my own landing page (because I un-commented the lines above and created my own APEX Landing Application with no Authentication)

    I know what you’re thinking… you really, really, really want it… OK stick this in inline CSS

     .t-Footer,.t-Header{display:none}*{margin:0;padding:0;box-sizing:border-box}body,html{height:100%;font-family:Arial,sans-serif;background-color:#2c3e50}.container{display:flex;align-items:center;justify-content:center;height:100%}.welcome-box{background-color:#ecf0f1;padding:40px;border-radius:10px;box-shadow:0 4px 8px rgba(0,0,0,.1);text-align:center;width:300px}.welcome-box h1{font-size:2.5em;color:#34495e}.welcome-box h2{font-size:2em;color:#2980b9;margin-bottom:20px}.welcome-box p{font-size:1.2em;color:#7f8c8d;margin-bottom:20px}.button{background-color:#2980b9;color:#fff;text-decoration:none;padding:10px 20px;border-radius:5px;transition:background-color .3s}.button:hover{background-color:#3498db}
    

    stick this in the HTML code within a blank with attribute region

     <div class=container><div class=welcome-box><h1>Welcome to</h1><h2>Custom ORDS</h2><p>Oracle REST Data Services (ORDS)</p><a class=button href=#get-started>Get Started</a></div></div>
    
  4. ENJOY!

(Optional) Disable Oracle Managed ORDS

  1. Change the ADBs Network settings so that its only accessible by the IP address of the ORDS.

     ifconfig | grep 'inet ' | awk '{ print $2 }'
    

ENJOY

What’s the picture? It’s a Band Stand in Wetherby. Here it is in action. Visit Yorkshire!

0
Subscribe to my newsletter

Read articles from Matt Mulvaney directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Matt Mulvaney
Matt Mulvaney

With around 20 years on the job, Matt is one of the most experienced software developers at Pretius. He likes meeting new people, traveling to conferences, and working on different projects. He’s also a big sports fan (regularly watches Leeds United, Formula 1, and boxing), and not just as a spectator – he often starts his days on a mountain bike, to tune his mind.