Skip to content
AbairTech Solution
  • Services
    • Chrome Extensions
  • Home
  • Live Demos
  • Mobile Apps
  • Business Software
  • Knowledge Center
  • Contact

Oracle APEX…

  • Home
  • Oracle APEX & Modernization
  • Oracle APEX…

Oracle APEX Load Balancing: Step-by-Step Guide with ORDS, Nginx and High Availability

  • By Muhammad Abair Mutarraf
  • November 24, 2026November 26, 2026

How to load balance Oracle APEX step by step: architecture, installing two ORDS nodes, sharing configuration and APEX images, Nginx load balancer with SSL, health checks, HTTPS header settings, database high availability, testing failover and common mistakes.

AbairTechSolutionDIGITAL SOLUTIONS FOR A SMARTER TOMORROW

HomeLive DemosMobile AppsBusiness SoftwareServicesKnowledge CenterInterview PrepContact
Menu
HomeLive DemosMobile AppsBusiness SoftwareServicesKnowledge CenterInterview PrepContact

Home › Knowledge Center › Oracle APEX

Oracle APEX · ORDS · High availability

Oracle APEX Load Balancing: Step-by-Step Guide with ORDS, Nginx and High Availability

By Muhammad Abair Mutarraf · Senior Oracle APEX & PL/SQL developer, 12 years’ experience · AbairTech Solution

Written by Muhammad Abair Mutarraf, Oracle Certified APEX Cloud Developer · Published November 2026 · Editorial policy
In short: to load balance Oracle APEX you run two or more Oracle REST Data Services (ORDS) servers with the same configuration, put a load balancer (Nginx, HAProxy, F5 or a cloud load balancer) in front of them, terminate SSL at the load balancer, tell ORDS which header means HTTPS, add a health check, and make the database itself highly available. APEX keeps session state in the database, so users can move between ORDS nodes without losing their session.

An Oracle APEX application that starts with ten users often ends up with five hundred: a factory ERP, a hospital system or a public portal. At that point one ORDS server becomes both a performance limit and a single point of failure – if it stops, nobody can work. Load balancing APEX solves both problems. This guide walks through the complete setup, from planning to failover testing, with configuration you can adapt for Oracle Linux, RHEL or Windows Server and for on-premises or cloud (OCI, AWS, Azure) deployments.

1. How Oracle APEX handles requests (why load balancing is straightforward)

Oracle APEX itself runs inside the Oracle Database. The web tier is ORDS, a Java application that receives browser requests and passes them to the database through a JDBC connection pool. Three facts make APEX easy to scale horizontally:

  • Session state lives in the database, not in ORDS memory. Any ORDS node can serve any request for any session.
  • ORDS nodes are stateless apart from their configuration and connection pool, so you can add or remove nodes freely.
  • Static files (the APEX /i/ images, JavaScript and CSS) are identical on every node, or can come from a CDN.

This means sticky sessions are not required for APEX. You can enable them on the load balancer if you like (some teams find it simpler for log reading), but the application does not depend on them.

2. Target architecture

Users (browser / mobile)
↓ HTTPS 443
Load balancer – Nginx / HAProxy / F5 / OCI LB
SSL termination · health checks
↓ HTTP 8080 (private network)
ORDS node 1
app1:8080
ORDS node 2
app2:8080
ORDS node 3 (optional)
↓ JDBC (database service)
Oracle Database with APEX
RAC, Data Guard or single instance
Layer Purpose Typical choice
Load balancer Spreads requests, terminates SSL, removes failed nodes Nginx or HAProxy on Linux; OCI/AWS/Azure load balancer in the cloud; F5 in large enterprises
ORDS nodes Run APEX requests and REST APIs 2+ servers (VMs or containers), same ORDS version and config
Database Stores APEX, data and session state Oracle 19c/23ai; RAC or Data Guard for database high availability

3. Step 1 – Plan before you install

  1. Versions: every ORDS node must run the same ORDS version, and the APEX images (/i/) must match the APEX version installed in the database.
  2. Hostnames and ports: e.g. app1.local:8080, app2.local:8080, public name apex.yourcompany.com.
  3. Certificates: a TLS certificate for the public name, installed on the load balancer.
  4. Connection pool size: decide the maximum JDBC connections per node, and make sure the database processes/sessions limits allow (nodes × max pool) plus your other connections.
  5. Firewall: users reach only the load balancer on 443; ORDS ports are open only to the load balancer; the database listener (1521) only to ORDS nodes and admins.

4. Step 2 – Install and configure ORDS on the first node

Install Java (a supported JDK version for your ORDS release) and ORDS, then run the installer against your database. If you are starting from scratch, our guide to installing Oracle 19c, APEX, ORDS and JasperReports covers the database and APEX side.

# Linux example – adjust paths to your environment
mkdir -p /etc/ords/config
ords --config /etc/ords/config install   # interactive: DB host, port, service name, passwords

# check the pool settings that were written
ords --config /etc/ords/config config list

Connect ORDS to a database service name, not a SID, and if you use RAC, to the SCAN address. That way the database can move the service between instances without changing ORDS.

Set the connection pool to suit your load (values here are a starting point, not a rule):

ords --config /etc/ords/config config set jdbc.InitialLimit 10
ords --config /etc/ords/config config set jdbc.MinLimit 10
ords --config /etc/ords/config config set jdbc.MaxLimit 60

5. Step 3 – Tell ORDS it is behind an HTTPS load balancer

The load balancer receives HTTPS and forwards plain HTTP to ORDS. Without extra configuration ORDS thinks requests are insecure, and you may see redirect loops, mixed-content warnings or “403 Forbidden” errors on login and form submissions. Configure the load balancer to send X-Forwarded-Proto: https and tell ORDS to trust it:

ords --config /etc/ords/config config set security.httpsHeaderCheck "X-Forwarded-Proto: https"

Also make sure the load balancer passes the original Host header, so URLs that APEX generates use the public name apex.yourcompany.com and not the internal node name.

6. Step 4 – Serve the APEX images on every node

Copy the images folder from the APEX installation zip (the version installed in your database) to the same path on each node, for example /opt/apex/images, and start ORDS with it:

ords --config /etc/ords/config serve --port 8080 --apex-images /opt/apex/images

Alternatively, point APEX to Oracle’s CDN for static files (Instance Administration → Instance Settings → image prefix), which removes the need to copy images and speeds up first page loads. Whichever you choose, every node must serve the same version.

Run ORDS as a service (systemd on Linux, a Windows service on Windows Server, or a container) so it restarts automatically after a reboot.

7. Step 5 – Add the second (and third) ORDS node

  1. Install the same Java and ORDS versions on the new server.
  2. Copy the whole ORDS configuration directory (/etc/ords/config) from node 1. It contains the pool settings and the stored credentials, so protect it like a password file.
  3. Copy the APEX images to the same path.
  4. Start ORDS on the same port and test it directly: http://app2.local:8080/ords/ should open the APEX login.

Keeping configuration identical is the single most important rule. A node with a different pool size, image path or HTTPS setting causes “random” errors that only some users see – the hardest kind of fault to diagnose.

8. Step 6 – Configure the load balancer (Nginx example)

Here is a working Nginx configuration for two ORDS nodes with SSL termination. HAProxy, F5 and cloud load balancers use the same ideas: a backend pool, a health check, and forwarded headers.

upstream ords_pool {
    least_conn;                       # send new requests to the least busy node
    server app1.local:8080 max_fails=3 fail_timeout=30s;
    server app2.local:8080 max_fails=3 fail_timeout=30s;
    keepalive 32;
}

server {
    listen 80;
    server_name apex.yourcompany.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name apex.yourcompany.com;

    ssl_certificate     /etc/nginx/ssl/apex.crt;
    ssl_certificate_key /etc/nginx/ssl/apex.key;

    client_max_body_size 50m;         # allow file uploads in APEX
    proxy_read_timeout   300s;        # long reports and processes

    location / {
        proxy_pass         http://ords_pool;
        proxy_http_version 1.1;
        proxy_set_header   Connection "";
        proxy_set_header   Host              $host;
        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 https;
    }
}

Notes on this configuration:

  • least_conn balances better than simple round robin when some APEX pages (reports, exports) take longer than others.
  • max_fails and fail_timeout give passive health checking in open-source Nginx: a node that keeps failing is taken out for 30 seconds. Commercial load balancers and HAProxy add active health checks (see the next step).
  • client_max_body_size must be large enough for file browse items, or uploads fail with “413 Request Entity Too Large”.
  • proxy_read_timeout must be longer than your slowest legitimate request, otherwise users see 504 errors on big reports.

9. Step 7 – Add a proper health check

A health check should prove that ORDS and the database connection work, not just that port 8080 is open. A simple way is a tiny ORDS REST endpoint that runs a query:

BEGIN
  ORDS.ENABLE_SCHEMA(p_schema => 'HEALTH_API');   -- run as a small, low-privilege schema
  ORDS.DEFINE_SERVICE(
    p_module_name => 'health',
    p_base_path   => 'health/',
    p_pattern     => 'ping',
    p_source      => 'SELECT ''OK'' AS status FROM dual');
  COMMIT;
END;
/

Point the load balancer’s health check at that URL (for example /ords/health_api/health/ping, depending on your schema alias) and expect HTTP 200. Restrict it to internal callers if you do not want it public.

10. Step 8 – Make the database highly available too

Two ORDS nodes do not help if the single database goes down. Match the database protection to the business need:

Option What it protects against Notes
Single instance + backups Data loss Downtime while you restore. See RMAN and Data Pump backups.
Data Guard (standby) Server or site failure Fail over to the standby; ORDS connects through a service that follows the primary.
RAC Instance failure, scaling database CPU ORDS connects to the SCAN address and service; work continues on surviving instances.

If ORDS uses a custom connect descriptor, include both addresses with failover:

(DESCRIPTION=
  (CONNECT_TIMEOUT=5)(RETRY_COUNT=3)
  (ADDRESS_LIST=(LOAD_BALANCE=on)(FAILOVER=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=db1.local)(PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=db2.local)(PORT=1521)))
  (CONNECT_DATA=(SERVICE_NAME=apexprod)))

11. Step 9 – Test everything, including failure

  1. Login and navigation: log in through https://apex.yourcompany.com/ords/, open several pages, submit forms and upload a file.
  2. Which node served the request: check each node’s access log while you click; requests should spread across nodes.
  3. Failover: stop ORDS on node 1 while logged in. Keep working – pages should continue to load from node 2 without logging you out, because the session is in the database.
  4. Recovery: start node 1 again and confirm the load balancer puts it back in the pool.
  5. Load test: use a tool such as JMeter or k6 with realistic user journeys, and watch database sessions, CPU and ORDS pool usage.
  6. Emails and links: confirm that links in emails sent by APEX use the public URL, not an internal hostname.

12. Common problems and fixes

Symptom Usual cause Fix
Redirect loop or 403 after login ORDS does not know the request was HTTPS Send X-Forwarded-Proto: https and set security.httpsHeaderCheck
Missing styles or icons on some requests Different or missing /i/ images on one node Copy the same images version to all nodes, or use the CDN
Links show app1.local:8080 Host header not forwarded proxy_set_header Host $host;
File uploads fail Load balancer body size limit Increase client_max_body_size
504 Gateway Timeout on big reports Proxy timeout shorter than the request Raise proxy_read_timeout, and tune the report – see APEX performance tuning
“No more data to read from socket” / pool exhausted Pool too small or database session limits Tune jdbc.MaxLimit and database sessions/processes
Errors only for some users Nodes configured differently Compare ords config list output on every node

13. Production checklist

  • Two or more ORDS nodes with identical version, configuration and APEX images
  • Load balancer with SSL, HTTP→HTTPS redirect and forwarded headers
  • security.httpsHeaderCheck set on every ORDS node
  • Health check that tests the database connection
  • Connection pools sized against database session limits
  • Database high availability matched to the business need (Data Guard or RAC) and tested backups
  • ORDS ports reachable only from the load balancer
  • Failover tested by stopping a node during a live session
  • Monitoring of node health, response time, pool usage and database load

Frequently asked questions

Do I need sticky sessions to load balance Oracle APEX?

No. APEX stores session state in the database, so any ORDS node can serve any request. Sticky sessions are optional.

Can I load balance APEX on Windows Server?

Yes. Run ORDS as a Windows service on two or more servers and use a load balancer in front, such as Nginx, HAProxy, IIS Application Request Routing or a hardware or cloud load balancer. The ORDS settings are the same.

How many ORDS nodes do I need?

Two is the minimum for high availability. Add nodes when CPU or connection pool usage on existing nodes stays high during peak hours. Often the database, not ORDS, is the real limit, so measure first.

Does load balancing make a slow APEX page faster?

Not by itself. It spreads users across servers and removes a single point of failure, but a slow query is still slow. Tune the SQL and page design as well.

Can I use Oracle Cloud (OCI) Load Balancer instead of Nginx?

Yes. Create a backend set with your ORDS nodes, an HTTPS listener with your certificate, a health check, and make sure the X-Forwarded-Proto header reaches ORDS. Oracle Autonomous Database already includes managed ORDS, so separate load balancing is usually only needed for customer-managed ORDS.

Related guides: install Oracle 19c, APEX and ORDS, Oracle APEX performance tuning, Oracle APEX 26.2 installation and upgrade, Oracle 19c backup basics and Oracle APEX tips and tricks.

Need high availability for APEX?

Get your load-balanced APEX and ORDS setup done for you

AbairTech plans and configures multi-node ORDS, Nginx load balancing, SSL and failover testing for Oracle APEX, then supports your applications. 12 years of Oracle experience, Oracle Certified APEX Cloud Developer.

Ask on WhatsAppOracle APEX development services →


Need a highly available Oracle APEX setup?

AbairTech installs, scales and supports Oracle APEX, ORDS and Oracle Database for ERP, HRMS and business systems – on-premises and in the cloud.

Oracle APEX ServicesMore GuidesWhatsApp Us

Knowledge Center · About · Contact · Privacy & Cookie Policy · Terms of Use · Advertising Disclosure · Editorial Standards

Muhammad Abair Mutarraf

Senior Oracle APEX, Oracle Forms and PL/SQL developer with 12 years of experience and founder of AbairTech Solution, Faisalabad. Oracle Certified APEX Cloud Developer who has led ERP and HRMS implementations and Oracle Forms to APEX modernization projects.

Search
Archives
  • November 2026
  • October 2026
  • September 2026
Opening Hours
Week Days 10:00 - 17:00
Saturday 10:00 - 15:00
Sunday Day Off
Contact us

Recent Posts

  • Oracle APEX Load Balancing: Step-by-Step Guide with ORDS, Nginx and High Availability
  • Oracle APEX Tips and Tricks + 40 Advanced MCQs with Answers (Developer Edition)
  • Inventory Valuation in ERP: FIFO vs Weighted Average Cost with Oracle SQL Examples
  • Leave Management in HRMS: Designing Accrual, Carry-Forward and Encashment Rules in Oracle
  • Oracle APEX Performance Tuning: How to Find and Fix Slow Pages

Recent Comments

  1. Shakir Hussain on Job Bank – Hire Developers & IT Students in Pakistan
  2. rabia naz on Job Bank – Hire Developers & IT Students in Pakistan

Popular Posts:

  • Oracle APEX Load Balancing: Step-by-Step Guide with ORDS, Nginx and High Availability
  • Oracle APEX Tips and Tricks + 40 Advanced MCQs with Answers (Developer Edition)
  • Inventory Valuation in ERP: FIFO vs Weighted Average Cost with Oracle SQL Examples
  • Leave Management in HRMS: Designing Accrual, Carry-Forward and Encashment Rules in Oracle
  • Oracle APEX Performance Tuning: How to Find and Fix Slow Pages

Categories:

  • API Integration
  • Business Software Guides
  • Jobs & Careers
  • Oracle APEX & Modernization
  • Oracle Database & PL/SQL
  • Technology Insights
  • Website Development

Popular Tags:

There’s no content to show here yet.

CONTACT US

Get in Touch With Us!

    Join us as we continue our mission to redefine digital standards and make a difference for businesses worldwide. Let’s work together to bring your digital dreams to life.

    Facebook-f Twitter Instagram

    Useful Links

    • Home
    • About
    • Services
    • Projects
    • Blog
    • Contact

    Our Services

    • Web Development
    • App Development
    • AI Development
    • Graphics Designing
    • SEO Service
    • Security Services

    Contact Info

    Faisalabad Pakistan

    support@abairtechsolution.com

    Call us now:

    +92 300 2005404

    Copyright © Abair Tech Solution 2024. All rights reserved

    We are using cookies to give you the best experience on our website.

    You can find out more about which cookies we are using or switch them off in .

    AbairTech Solution
    Powered by  GDPR Cookie Compliance
    Privacy Overview

    This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

    Strictly Necessary Cookies

    Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

    If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.