---
title: APEX behind a Custom Domain using Oracle Cloud and NGINX
description: The NGINX web server is fast, reliable and easy to configure, this blog explains how to set up a reverse proxy and configure it to accept incoming traffic.
image: https://content.dsp.co.uk/hubfs/LinkedIn%20-%20Templates%20%20-%202023-06-06T130609.265.jpg
---

[![DSP From Ground to Cloud](https://content.dsp.co.uk/hubfs/Logos/DSP%20From%20Ground%20to%20Cloud/DSP-Logo-Colour-From-Ground-to-Cloud.svg "DSP From Ground to Cloud")](https://dsp.co.uk)

[![DSP From Ground to Cloud](https://content.dsp.co.uk/hs-fs/hubfs/2023/Logos/DSP/DSP-Logo-2019-White-600px.png?width=70&height=72&name=DSP-Logo-2019-White-600px.png "DSP From Ground to Cloud")](https://dsp.co.uk)

- Services 
    - Consulting Services 
          - [Oracle](https://www.dsp.co.uk/oracle-consultancy)
          - [Microsoft](https://www.dsp.co.uk/sql-server-consultancy)
          - [Google](https://www.dsp.co.uk/google-cloud-consultancy)
          - [Architecture](https://www.dsp.co.uk/solution-design-and-architecture)
    - Managed Services 
          - [Oracle Managed Services](https://www.dsp.co.uk/oracle-managed-services)
          - [SQL Server Managed Services](https://www.dsp.co.uk/sql-server-managed-services)
          - [OCI Managed Services](https://www.dsp.co.uk/oracle-cloud-infrastructure-managed-services)
          - [Azure Managed Services](https://www.dsp.co.uk/azure-managed-services)
          - [On Premise Apps Managed Services](https://www.dsp.co.uk/application-managed-services)
          - [Cloud Apps Managed Services](https://www.dsp.co.uk/oracle-cloud-applications-services)
    - Licensing and SAM 
          - [Oracle Licensing](https://www.dsp.co.uk/oracle-licensing-services)
          - [Software Asset Management](https://www.dsp.co.uk/oracle-software-asset-management-sam)
    - Application Services 
          - [Application Development](https://www.dsp.co.uk/software-development)
          - [Application Modernisation](https://www.dsp.co.uk/legacy-software-modernisation)
          - [Oracle Forms to Oracle APEX](https://www.dsp.co.uk/oracle-forms-to-oracle-apex)
          - [Application Extensions](https://www.dsp.co.uk/software-customisation)
          - [Archiving Solutions](https://www.dsp.co.uk/application-archiving-solution)
          - [Application Hosting](https://www.dsp.co.uk/oracle-apex-hosting-services)
          - [Development Training](https://www.dsp.co.uk/oracle-apex-training)
    - Data Science 
          - [AI Strategy](https://www.dsp.co.uk/ai-strategy)
          - [Responsible AI and Governance](https://www.dsp.co.uk/responsible-ai)
          - [Agentic AI](https://www.dsp.co.uk/agentic-ai)
          - [Data Management for AI](https://www.dsp.co.uk/data-management)
          - [Power BI](https://www.dsp.co.uk/power-bi-services)
          - [Microsoft Fabric](https://www.dsp.co.uk/microsoft-fabric-services)
          - [Machine Learning](https://www.dsp.co.uk/oci-machine-learning)
    - Cloud Migration and Management 
          - [Cloud Readiness and Design](https://www.dsp.co.uk/oracle-cloud-readiness-assessment)
          - [Migration to Fusion and Cloud Applications](https://www.dsp.co.uk/oracle-cloud-application-modernisation)
          - [Migration to Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-migration)
          - [Private Cloud](https://www.dsp.co.uk/oracle-private-cloud-services)
          - [Database@ Hyperscaler](https://www.dsp.co.uk/multicloud-management)
          - [FinOps and Optimisation](https://www.dsp.co.uk/optimise-oracle-cloud-infrastructure)
    - Integration and APIs 
          - [API Management](https://www.dsp.co.uk/api-development-services)
          - [GoldenGate](https://www.dsp.co.uk/oracle-goldengate-services)
    - Disaster Recovery and Security 
          - [Disaster Recovery](https://www.dsp.co.uk/oracle-database-disaster-recovery-solutions)
          - [Security Compliance](https://www.dsp.co.uk/data-security)
          - [Cloud Security](https://www.dsp.co.uk/cloud-security)
  
  
  
   
  
  ![Oracle Partner, Microsoft Partner and Google Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/multiple-vendor/rectangle-2022/Partner-logos-rectangle-Nov21.svg)
  
  
  
  
  
  
  
  #### Getting to know us
  
    - [About us](https://www.dsp.co.uk/about)
    - [What we do](https://www.dsp.co.uk/what-we-do)
    - [Leadership](https://www.dsp.co.uk/dsp-product-leads)
    - [Careers](https://www.dsp.co.uk/careers)
- Technologies 
    - Oracle Cloud Infrastructure 
          - [Oracle Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-infrastructure-services)
          - [IaaS](https://www.dsp.co.uk/iaas)
          - [PaaS](https://www.dsp.co.uk/paas-security)
    - Oracle Database 
          - [Oracle Database](https://www.dsp.co.uk/oracle-database-consulting)
          - [Autonomous Database](https://www.dsp.co.uk/oracle-autonomous-database-services)
          - [MySQL and Heatwave](https://www.dsp.co.uk/mysql-services)
          - [Oracle APEX](https://www.dsp.co.uk/oracle-apex-services)
    - Oracle Engineered Systems 
          - [Oracle Exadata](https://www.dsp.co.uk/exadata-database-service-consultancy)
          - [Oracle Database Appliance](https://www.dsp.co.uk/oracle-database-appliance)
    - Oracle Applications 
          - [Oracle Fusion and Cloud Applications](https://www.dsp.co.uk/oracle-fusion-services)
          - [Oracle E-Business Suite](https://www.dsp.co.uk/oracle-ebs-services)
          - [JD Edwards](https://www.dsp.co.uk/jd-edwards-services)
          - [Peoplesoft](https://www.dsp.co.uk/oracle-peoplesoft-services)
          - [Hyperion](https://www.dsp.co.uk/oracle-hyperion-services)
    - Microsoft 
          - [SQL Server](https://www.dsp.co.uk/sql-server-consultancy)
          - [Microsoft Azure](https://www.dsp.co.uk/microsoft-azure-services)
          - [Power BI](https://www.dsp.co.uk/power-bi-services)
          - [Microsoft Fabric](https://www.dsp.co.uk/microsoft-fabric-services)
    - Google 
          - [Google Cloud Platform (GCP)](https://www.dsp.co.uk/google-cloud-partner)
    - Multicloud and Database Hyperscaler 
          - [Oracle Database@Azure](https://www.dsp.co.uk/oracle-databaseazure-partner)
          - [Oracle Database@GCP](https://www.dsp.co.uk/google-cloud-machine-learning)
          - [Oracle Database@AWS](https://www.dsp.co.uk/amazon-web-services-aws)
          - [Oracle Azure Interconnect](https://www.dsp.co.uk/oracle-microsoft-multicloud)
    - Open Source Database 
          - [PostgreSQL](https://www.dsp.co.uk/postgresql-services)
          - [MySQL](https://www.dsp.co.uk/mysql-services)
          - [MariaDB](https://www.dsp.co.uk/migration-from-mariadb-to-mysql)
  
  
  
  #### Managed Services
  
    - [Oracle Database](https://www.dsp.co.uk/oracle-managed-services)
    - [SQL Server](https://www.dsp.co.uk/sql-server-managed-services)
    - [MySQL](https://www.dsp.co.uk/mysql-support)
  
  
  
  
  
  
  #### Application Services
  
    - [Oracle Applications](https://www.dsp.co.uk/oracle-application-cloud-migration)
    - [Oracle APEX](https://www.dsp.co.uk/oracle-apex-services)
    - [Microsoft](https://www.dsp.co.uk/microsoft-partnership)
    - [ISV Services](https://www.dsp.co.uk/isv-support-and-services)
  
  
  
  
  
  
  
  
  #### Cloud Services
  
    - [Oracle Cloud Infrastructure](https://www.dsp.co.uk/oracle-cloud-services)
    - [Microsoft Azure](https://www.dsp.co.uk/microsoft-azure-services)
    - [Google Cloud Platform](https://www.dsp.co.uk/gcp-database)
    - [Multi-cloud](https://www.dsp.co.uk/oracle-microsoft-multicloud)
  
  
  
  
  
  
  #### Data Science
  
    - [Machine Learning](https://www.dsp.co.uk/machine-learning-consulting-services)
    - [Business Intelligence](https://www.dsp.co.uk/business-intelligence-services)
    - [Artificial Intelligence](https://www.dsp.co.uk/artificial-intelligence-consulting-services)
  
  
  
  
  
  
  
  
  #### Consulting Services
  
    - [Oracle](https://www.dsp.co.uk/oracle-consultancy)
    - [Microsoft](https://www.dsp.co.uk/sql-server-consultancy)
    - [Google](https://www.dsp.co.uk/google-cloud-consultancy)
    - [Cloud Migration](https://www.dsp.co.uk/cloud-migrations)
  
  
  
  
  
  
  #### Technology Solutions
  
    - [Engineered Systems](https://www.dsp.co.uk/oracle-engineered-systems-partner)
    - [Data Security](https://www.dsp.co.uk/data-security)
    - [Database Architecture](https://www.dsp.co.uk/solution-design-and-architecture)
    - [Disaster Recovery](https://www.dsp.co.uk/database-disaster-recovery)
- Industries 
    - [Finance](https://www.dsp.co.uk/finance)
    - [Healthcare](https://www.dsp.co.uk/healthcare-it-services)
    - [Travel and Transport](https://www.dsp.co.uk/database-solutions-for-travel-and-transport)
    - [Higher Education](https://www.dsp.co.uk/higher-education)
    - [Public Sector](https://www.dsp.co.uk/public-sector)
    - [Manufacturing](https://www.dsp.co.uk/manufacturing)
    - [Retail](https://www.dsp.co.uk/retail)
    - [Software Vendors](https://www.dsp.co.uk/isv-support-and-services)
  
  
  
  ### Recent case study:
  
  #### Oracle EBS Cloud Deployment
  
  Consolidating and Migrating assets into Oracle Cloud Infrastructure.
  
  [**![Oracle EBS Cloud Deployment](https://content.dsp.co.uk/hs-fs/hubfs/stonewater-logo%20(1).png?width=250&name=stonewater-logo%20(1).png)**](https://www.dsp.co.uk/stonewater)
  
   
  
  
  
  
  
  
  
  #### Most Visited Pages
  
    - [Oracle Licensing](https://www.dsp.co.uk/oracle-licensing)
    - [Oracle Cloud Calculator](https://www.oracle-cloud-calculator.com/)
    - [Oracle Cloud Migration](https://www.dsp.co.uk/oracle-cloud-migration)
    - [Oracle Exadata Services](https://www.dsp.co.uk/oracle-exadata-services)
    - [Artificial Intelligence Services](https://www.dsp.co.uk/artificial-intelligence-consulting-services)
  
  
  
  
  
  
  
  
  #### -
  
    - [SQL Server Support](https://www.dsp.co.uk/sql-server-support)
    - [Oracle Support](https://www.dsp.co.uk/oracle-support)
    - [Google Cloud Consultancy](https://www.dsp.co.uk/google-cloud-consultancy)
    - [New Application Development](https://www.dsp.co.uk/oracle-apex-services)
    - [Azure Virtual Desktop](https://www.dsp.co.uk/azure-virtual-desktop)
- Resources 
    - [Gartner ](https://www.dsp.co.uk/complimentary-gartner-download)
    - [ISG](https://www.dsp.co.uk/isg-oracle-report)
    - [Blogs](https://www.dsp.co.uk/blogs)
    - [Case Studies](https://www.dsp.co.uk/case-studies)
    - [Testimonials](https://www.dsp.co.uk/testimonials)
    - [Events](https://www.dsp.co.uk/events)
    - [Webinars](https://www.dsp.co.uk/webinars)
    - [Insights](https://www.dsp.co.uk/insights)
    - [Technical Resources](https://www.dsp.co.uk/technical-resources)
  
  
  
  ### DSP-Explorer acquires leading Oracle Applications Managed Services Provider, Claremont, to further extend its data management capabilities.
  
   
  
  [![Read More](https://no-cache.hubspot.com/cta/default/3321273/c7e13c9c-65e1-46e7-8541-8da86a4fc305.png)](https://cta-redirect.hubspot.com/cta/redirect/3321273/c7e13c9c-65e1-46e7-8541-8da86a4fc305)
  
  
  
  
  
  
  
  #### Resources
  
    - [Blogs](https://www.dsp.co.uk/blogs)
    - [Webinars](https://www.dsp.co.uk/webinars)
    - [Case Studies](https://www.dsp.co.uk/case-studies)
    - [Testimonials](https://www.dsp.co.uk/testimonials)
- About 
    - [About DSP](https://www.dsp.co.uk/about)
    - [What We Do](https://www.dsp.co.uk/what-we-do)
    - [DSP Group Board ](https://www.dsp.co.uk/dsp-group-board)
    - [Careers](https://www.dsp.co.uk/careers)
    - [Project Harar](https://www.dsp.co.uk/project-harar)
- [Customer Area](https://www.dsp.co.uk/contact-us) 
    - [Customer Support Portal](https://dspgroup-ism.ivanticloud.com/)
    - [Customer Resources](https://www.dsp.co.uk/welcome)
- [Contact us](https://www.dsp.co.uk/contact-us)

# APEX behind a Custom Domain using Oracle Cloud and NGINX

[ Alastair Steele ](https://content.dsp.co.uk/author/alastair-steele) 06-Jun-2023 16:38:55

### Contents

[23-Aug-2021 09:46:00

How to view HubSpot engagement information in an APEX application

](https://content.dsp.co.uk/how-to-view-hubspot-engagement-information-in-an-apex-application) [14-Aug-2024 16:30:20

APEX 24.1 – Document Generator Remote Printing

](https://content.dsp.co.uk/apex-24.1-document-generator-remote-printing) [29-Sep-2022 11:52:23

Sending emails from an APEX application in the cloud

](https://content.dsp.co.uk/sending-emails-from-an-apex-application-in-the-cloud)

Oracle provides both the [most capable database](https://www.oracle.com/database/) and the [most popular low-code platform](https://apex.oracle.com/en/). So why not pair them with the most popular web server? [1]

The NGINX web server is fast, reliable, and easy to configure, and the steps in this blog will explain how to set up a reverse proxy [2] in front of an Oracle Autonomous Database and configure it to accept incoming traffic from a custom domain securely.

A spiritual successor to several blogs from the 'Best and Cheapest Oracle APEX hosting: Free Oracle Cloud' series by Dimitri Gielis [3]. This blog covers several of those topics, streamlines the steps taken, reflects the latest Oracle Cloud interface/configuration options and improves the certificate auto-renewal setup.

## Why a Web Server?

For all the benefits of using a free autonomous database provided by [Oracle Cloud](https://www.dsp.co.uk/oracle-cloud-services), there is at least one issue; the URL to access your [APEX](https://www.dsp.co.uk/oracle-apex-services) instance begins:

https://g29ff0ee73ee766-example.adb.uk-london-1.oraclecloudapps.com/ords/

Not so much of an issue for personal or research projects but certainly undesirable for public-facing applications. As it happens, I've already purchased a domain and would like to make use of it here to achieve:

[https://apex-labs.dev/ords/](https://apex-labs.dev/ords/)

Given the objective, the most flexible and well-rounded solution would be to configure an Oracle Cloud hosted web server to route traffic coming from apex-labs.dev to our database. There are a few additional benefits when taking this approach:

- Certificates auto-renew i.e. maintenance-free (at the time of writing this can't be achieved when using an Oracle Cloud provided load balancer to route traffic).
- NGINX can also act as a load balancer if that is one of your requirements.
- Can be used to install and configure customer-managed ORDS.
- Can be used to host a website.
- Can be used to host static application/workspace files (APEX CDN is still recommended for APEX files).

Starting with the infrastructure requirements, we will create our free autonomous database and compute instance, configure the VCN (virtual cloud network) and DNS (domain name system) to accept and route web traffic, and then install and configure NGINX.

## Autonomous Database

1. Open the main menu.  
2. Click the 'Oracle Database' category and then the 'Autonomous Database' header from the expanded menu.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_01%5B11855%5D.png?width=1920&height=676&name=image_01%5B11855%5D.png)](https://content.dsp.co.uk/hubfs/image_01%5B11855%5D.png)

3. Click the 'Create Autonomous Database' button.  
4. Choose a workload type.

*APEX is available with all database types, but I’d recommend either 'Transaction Processing' or 'APEX' types, depending on the environment. The main difference between the two is a database of type 'APEX' does not accept direct connections [4] but is two/three times cheaper than a database of type 'Transaction Processing', which does allow direct connections.*

*As two 'Always Free' databases are allowed per tenancy, and assuming we are catering for small businesses and startups, I would suggest the following:*

*Production: 'APEX' type (Paid)  
**Test: 'APEX' type (Always Free)*  
*Development: 'Transaction Processing' type (Always Free)*

5. Under 'Create administrator credentials', type and confirm a password for the database 'ADMIN' user. Remember to make a note of the password.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_02%5B11834%5D.png?width=1245&height=331&name=image_02%5B11834%5D.png)](https://content.dsp.co.uk/hubfs/image_02%5B11834%5D.png)

6. Click the 'Create Autonomous Database' button.  
7. Now on the 'Autonomous Database details' page, wait for the database status to change from 'PROVISIONING' to 'AVAILABLE' and for the icon to turn green. Then click the 'Database actions' button.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_03%5B11835%5D.png?width=747&height=60&name=image_03%5B11835%5D.png)](https://content.dsp.co.uk/hubfs/image_03%5B11835%5D.png)

8. Wait for the page to load, then make a note of the FQDN (fully qualified domain name) e.g. [https://g29ff0ee73ee766-example.adb.uk-london-1.oraclecloudapps.com](https://g29ff0ee73ee766-example.adb.uk-london-1.oraclecloudapps.com)

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_04%5B11836%5D.png?width=1920&height=937&name=image_04%5B11836%5D.png)](https://content.dsp.co.uk/hubfs/image_04%5B11836%5D.png)

## Compute Instance

1. Open the main menu.  
2. Click the 'Compute' category and then the 'Instances' option from the expanded menu.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_05%5B11837%5D.png?width=1920&height=676&name=image_05%5B11837%5D.png)](https://content.dsp.co.uk/hubfs/image_05%5B11837%5D.png)

3. Click the 'Create instance' button.  
4. Under 'Image and shape' leave as default.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_06%5B11838%5D.png?width=1231&height=200&name=image_06%5B11838%5D.png)](https://content.dsp.co.uk/hubfs/image_06%5B11838%5D.png)

5. Under 'Networking' click the 'Edit' link, then select 'Create new virtual cloud network'. After selection, the section should automatically populate with default values. Make a note of the 'New virtual cloud network name'.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_07%5B11839%5D.png?width=1231&height=719&name=image_07%5B11839%5D.png)](https://content.dsp.co.uk/hubfs/image_07%5B11839%5D.png)

6. Under 'Add SSH keys', click the 'Save private key' button and 'Save public key' link.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_08%5B11840%5D.png?width=1231&height=324&name=image_08%5B11840%5D.png)](https://content.dsp.co.uk/hubfs/image_08%5B11840%5D.png)

7. Under 'Boot volume' and 'Live migration' leave as default.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_09%5B11841%5D.png?width=1226&height=492&name=image_09%5B11841%5D.png)](https://content.dsp.co.uk/hubfs/image_09%5B11841%5D.png)

8. Click the 'Create' button.  
9. Now on the 'Instance details' page, wait for the instance status to change from 'PROVISIONING' to 'RUNNING' and for the icon to turn green.  
10. Make a note of the 'Public IP address'.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_10%5B11842%5D.png?width=788&height=169&name=image_10%5B11842%5D.png)](https://content.dsp.co.uk/hubfs/image_10%5B11842%5D.png)

## VCN and DNS

1. Open the main menu.  
2. Click the 'Networking' category and then the 'Virtual cloud networks' headers from the expanded menu.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_11%5B11843%5D.png?width=1920&height=676&name=image_11%5B11843%5D.png)](https://content.dsp.co.uk/hubfs/image_11%5B11843%5D.png)

3. Click the name of the VCN created during the compute instance setup.  
4. Click 'Security Lists' under 'Resources', then select the 'Default Security List for …' Security List.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_12%5B11844%5D.png?width=1920&height=579&name=image_12%5B11844%5D.png)](https://content.dsp.co.uk/hubfs/image_12%5B11844%5D.png)

5. Click 'Add Ingress Rules'.  
6. Under 'Ingress Rule 1' add the following:

Source CIDR: 0.0.0.0/0  
Destination Port Range: 80

7. Click '+Another Ingress Rule'.  
8. Under 'Ingress Rule 2' add the following:

Source CIDR: 0.0.0.0/0  
Destination Port Range: 443

9. Click 'Add Ingress Rules'.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_13%5B11845%5D.png?width=1920&height=493&name=image_13%5B11845%5D.png)](https://content.dsp.co.uk/hubfs/image_13%5B11845%5D.png)

10. Navigate to your domain provider, in my case, this is Google Domains.  
11. For your chosen domain:

a. Enter the following 'A' record:

i. Detail: IP address (public IP address of compute instance noted earlier)

b. Enter the following, 'CNAME' record:

i. Name: www  
ii. Detail: domain name

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_14%5B11846%5D.png?width=1032&height=429&name=image_14%5B11846%5D.png)](https://content.dsp.co.uk/hubfs/image_14%5B11846%5D.png)

## NGINX Domain Config

1. Using the private key saved earlier, connect to your compute instance using your SSH client of choice.  
2. Run the following commands to install NGINX:

$ sudo su  
$ yum update  
$ yum install nginx  
$ systemctl start nginx  
$ systemctl status nginx

3. The NGINX service should report that it has loaded successfully and is running.

*"Failed to parse PID from file /run/nginx.pid" is a known false negative that sometimes occurs on single-core systems. It is safe to ignore and does not affect the NGINX service.*

[*![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_15%5B11847%5D.png?width=996&height=368&name=image_15%5B11847%5D.png)*](https://content.dsp.co.uk/hubfs/image_15%5B11847%5D.png)

4. Run the following commands to open the compute instance firewall to web traffic:

$ firewall-cmd --permanent --zone=public --add-service=http  
$ firewall-cmd --permanent --zone=public --add-service=https  
$ firewall-cmd --reload

5. Confirm the firewall is open by entering the public IP address into your browser.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_16%5B11848%5D.png?width=1920&height=390&name=image_16%5B11848%5D.png)](https://content.dsp.co.uk/hubfs/image_16%5B11848%5D.png)

6. Locally, create a file named your_domain.conf (e.g. apex-labs.dev.conf) with the following data (amending for your domain):

server {  
    listen         80;  
    listen         [::]:80;  
    server_name    apex-labs.dev www.apex-labs.dev;  
    root           /usr/share/nginx/html;  
    index          index.html;  
    try_files $uri /index.html;  
}

7. Locally, use the SCP command to transfer the file to the compute instance.

$ scp -i local_path_to_private_key apex-labs.dev.conf opc@141.147.80.70:/home/opc

8. From the compute instance, run the following commands to load and confirm the NGINX configuration file for your domain:

$ cp /home/opc/apex-labs.dev.conf /etc/nginx/conf.d/apex-labs.dev.conf  
$ nginx -t

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_17%5B11849%5D.png?width=544&height=116&name=image_17%5B11849%5D.png)](https://content.dsp.co.uk/hubfs/image_17%5B11849%5D.png)

$ nginx -s reload

9. Run the following commands to install snap [5]:

$ dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm  
$ dnf upgrade  
$ yum install snapd  
$ systemctl enable --now snapd.socket  
$ ln -s /var/lib/snapd/snap /snap

10. To complete the installation, disconnect and reconnect to the compute instance, then wait ~30 seconds before proceeding.  
11. Run the following commands to install and run certbot [6]:

$ sudo su  
$ sudo snap install core; sudo snap refresh core  
$ snap install --classic certbot  
$ ln -s /snap/bin/certbot /usr/bin/certbot  
$ certbot --nginx

12. Confirm your NGINX domain configuration is working by entering your domain into your browser e.g. [www.apex-labs.dev](http://www.apex-labs.dev)

## NGINX APEX Config

1. Certbot automatically updates the NGINX configuration file we uploaded earlier. Locally, run the following commands to retrieve the updated file:

$ scp -i local_path_to_private_key opc@141.147.80.70:/etc/nginx/conf.d/apex-labs.dev.conf apex-labs.dev.conf

2. Update the configuration file with the following blocks (amending the 'proxy pass' FQDNs with the one you made a note of during the autonomous database setup):

location /ords/ {  
    proxy_pass https://g29ff0ee73ee766-example.adb.uk-london-1.oraclecloudapps.com/ords/;  
    proxy_set_header Origin "";  
    proxy_set_header X-Forwarded-Host $host:$server_port;  
    proxy_set_header X-Real-IP $remote_addr;  
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
    proxy_set_header X-Forwarded-Proto $scheme;  
    proxy_connect_timeout 600;  
    proxy_send_timeout 600;  
    proxy_read_timeout 600;  
    send_timeout 600;  
}

location /i/ {  
    proxy_pass https://g29ff0ee73ee766-example.adb.uk-london-1.oraclecloudapps.com/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;  
}

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_18%5B11850%5D.png?width=740&height=923&name=image_18%5B11850%5D.png)](https://content.dsp.co.uk/hubfs/image_18%5B11850%5D.png)

1. Locally, use the SCP command to transfer the file to the compute instance.

$ scp -i local_path_to_private_key apex-labs.dev.conf opc@141.147.80.70:/home/opc

2. From the compute instance, run the following commands to load and confirm the NGINX configuration file for your domain:

$ cp /home/opc/apex-labs.dev.conf /etc/nginx/conf.d/apex-labs.dev.conf  
$ nginx -t

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_19%5B11851%5D.png?width=544&height=116&name=image_19%5B11851%5D.png)](https://content.dsp.co.uk/hubfs/image_19%5B11851%5D.png)

$ nginx -s reload

3. Run the following command to allow the compute instance to initiate a network connection to the autonomous database (required because the 'Use in-transit encryption' option was enabled for the compute instance):

$ setsebool httpd_can_network_connect 1 -P

4. Finally, we can set NGINX to start automatically in case the compute instance is ever rebooted (e.g. either manually to clear a stuck process or automatically due to Oracle Cloud maintenance).

$ systemctl enable nginx

5. Confirm your APEX URL configuration is working by entering your APEX URL into your browser e.g. [www.apex-labs.dev/ords/apex](http://www.apex-labs.dev/ords/apex).

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_20%5B11852%5D.png?width=1920&height=937&name=image_20%5B11852%5D.png)](https://content.dsp.co.uk/hubfs/image_20%5B11852%5D.png)

6. Sign In using the 'ADMIN' password you made a note of during the autonomous database setup.

[![APEX behind a Custom Domain using Oracle Cloud and NGINX](https://content.dsp.co.uk/hs-fs/hubfs/image_21%5B11853%5D.png?width=1920&height=937&name=image_21%5B11853%5D.png)](https://content.dsp.co.uk/hubfs/image_21%5B11853%5D.png)

## Conclusion

In summary, taking on the mantle of cloud/network/systems engineer, we have provisioned an autonomous database and a compute instance, updated the associated VCN and DNS settings to route traffic, and remotely connected to the compute instance to install various packages and configuration files allowing us to process that traffic in a secure, user-friendly, and maintenance-free way.

For more information, check out our [APEX services](https://www.dsp.co.uk/oracle-apex-services), and if you liked this blog, check out our other [APEX blogs here](https://content.dsp.co.uk/apex).

[1] 34.4% of all known web servers. See the full list at [https://w3techs.com/technologies/overview/web_server](https://w3techs.com/technologies/overview/web_server)

[2] Learn more about reverse proxy servers at [https://www.nginx.com/resources/glossary/reverse-proxy-server/](https://www.nginx.com/resources/glossary/reverse-proxy-server/).

[3] Read the blog series at [https://dgielis.blogspot.com/2019/09/best-and-cheapest-oracle-apex-hosting.html](https://dgielis.blogspot.com/2019/09/best-and-cheapest-oracle-apex-hosting.html).

[4] Like those coming from SQL Developer or SQLcl. Instead, use SQL Developer Web from within Oracle Cloud or SQL Commands from within APEX.

[5] A package host and distribution platform. Learn more at [https://snapcraft.io/](https://snapcraft.io/). Install steps taken from [https://snapcraft.io/docs/installing-snap-on-red-hat](https://snapcraft.io/docs/installing-snap-on-red-hat).

[6] An open-source tool used to automate the provision and renewal of Let’s Encrypt certificates. Learn more at [https://certbot.eff.org/](https://certbot.eff.org/). Install steps taken from [https://certbot.eff.org/instructions?ws=nginx&os=snap](https://certbot.eff.org/instructions?ws=nginx&os=snap).

[Oracle Cloud](https://content.dsp.co.uk/topic/oracle-cloud) [Oracle](https://content.dsp.co.uk/topic/oracle) [APEX](https://content.dsp.co.uk/topic/apex) [Oracle APEX](https://content.dsp.co.uk/topic/oracle-apex)

[23-Aug-2021 09:46:00

How to view HubSpot engagement information in an APEX application

](https://content.dsp.co.uk/how-to-view-hubspot-engagement-information-in-an-apex-application) [14-Aug-2024 16:30:20

APEX 24.1 – Document Generator Remote Printing

](https://content.dsp.co.uk/apex-24.1-document-generator-remote-printing) [29-Sep-2022 11:52:23

Sending emails from an APEX application in the cloud

](https://content.dsp.co.uk/sending-emails-from-an-apex-application-in-the-cloud)

[Previous

5 reasons why your Oracle E-Business Suite needs a health check

](https://content.dsp.co.uk/5-reasons-why-your-oracle-e-business-suite-needs-a-health-check)

[Next

Creating APIs in Python Flask

](https://content.dsp.co.uk/creating-apis-in-python-flask)

#### Contact

Sales Enquiries  
[+44 (0) 203 880 1686](tel:+4420%2038801686)

Technical Support  
+44 (0) 330 058 8367

[enquiries@dsp.co.uk](mailto:enquiries@dsp.co.uk)

#### Follow us

<https://www.linkedin.com/company/dsp-explorer> <https://twitter.com/dspexplorer> <https://www.facebook.com/DSPcloud>

#### Office Locations

[**London (Head Office)**](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,198m/data=!3m2!1e3!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MTAwOC4wIKXMDSoASAFQAw%3D%3D)  
[Chancery House](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[53-64 Chancery Lane](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[London](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)  
[WC2A 1QS](https://www.google.com/maps/place/Fora+-+Chancery+House/@51.5174484,-0.1139686,19z/data=!3m1!5s0x48761adea956397d:0xb7585122cbe86fc0!4m6!3m5!1s0x48761b4b75bf77fb:0x97c4f0ad56af6d23!8m2!3d51.5174586!4d-0.1129066!16s%2Fg%2F11h_cy7xk5?entry=ttu&g_ep=EgoyMDI1MDkyOS4wIKXMDSoASAFQAw%3D%3D)

[**Leeds**  
Richmond House,  
Lawnswood Business Park,  
Leeds,  
LS16 6QY](https://www.google.com/maps/dir/53.8405223,-1.6062773/DSP-Explorer/@53.8404788,-1.6061783,17z/data=!4m9!4m8!1m1!4e1!1m5!1m1!1s0x4879591e5d204ac9:0x4e41b926d72adca!2m2!1d-1.6064847!2d53.8404842)

[**Derby**](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[Cubo Pride Park,](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[1 Pride Place](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[Derby](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
[DE24 8QR](https://www.google.com/maps/place/Cubo+Pride+Park/@52.9142877,-1.4558952,331m/data=!3m2!1e3!5s0x4879f10728c1eea1:0x877f85530d38bf6!4m15!1m8!3m7!1s0x4879f1072b0e2ebb:0x7c717035ff049b12!2sPride+Pl,+Derby+DE24+8QR!3b1!8m2!3d52.913692!4d-1.4543743!16s%2Fg%2F1th7mf0r!3m5!1s0x4879f16809382b33:0x6fccc05b8500d970!8m2!3d52.914146!4d-1.4544105!16s%2Fg%2F11w4j8v8z2?entry=ttu&g_ep=EgoyMDI1MDYyMi4wIKXMDSoASAFQAw%3D%3D)  
**  
[Dublin](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)**  
[Inniscarra,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Main Street,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Rathcoole,](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)  
[Dublin](https://www.google.com/maps/search/Inniscarra,+Main+Street,+Rathcoole,+Dublin/@53.2810032,-6.4764674,17z/data=!3m1!4b1?entry=ttu)<https://www.google.com/maps/place/70+Gracechurch+St,+Langbourn,+London+EC3V+0XL/@51.512117,-0.0869173,17z/data=!3m1!4b1!4m5!3m4!1s0x4876035256ab55cb:0x1f93b337c0190cf0!8m2!3d51.512117!4d-0.0847286><https://www.google.com/maps/place/Devonshire+House/@51.2797714,-1.0679275,15z/data=!4m5!3m4!1s0x0:0x4f204507edd15263!8m2!3d51.2797718!4d-1.0679748>

#### About Us

DSP is a Data Management and Cloud Platform MSP that delivers enterprise grade support & consulting services for Oracle, Microsoft and Multi-Cloud technologies.

![Oracle Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/Oracle-logos/Colour/o-prtnr-cmyk-250.png)

![Microsoft Partner](https://content.dsp.co.uk/hubfs/Microsoft%20partner%20logos%20-%20July%202023/mic-sol-part-colour@200x.png)

![Google Cloud Partner](https://content.dsp.co.uk/hubfs/logo-2021/Partner-logos/GCP-Logos/Google-Cloud-Partner%20(1).svg)

Registered Office: 30 City Road, London, EC1Y 2AB.  
Company Registration Number: 03898451

<https://content.dsp.co.uk/apex-behind-a-custom-domain-using-oracle-cloud-and-nginx#>

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "dateModified" : "2024-10-01",
  "datePublished" : "2024-10-01",
  "headline" : "APEX behind a Custom Domain using Oracle Cloud and NGINX",
  "image" : [ "https://www.dsp.co.uk/hubfs/LinkedIn%20-%20Templates%20%20-%202023-06-06T130609.265.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://content.dsp.co.uk/apex-behind-a-custom-domain-using-oracle-cloud-and-nginx",
    "@type" : "WebPage"
  }
}
```