Score:0

How to beautify the URL with NGINX and Tomcat for Oracle APEX

cn flag

I've been trying to configure my NGINX to have nicer URL with my Oracle APEX apps but I am struggling to figure out what I am missing.

My Tomcat and NGINX are in the same server, and the ORDS has been deployed and is available under http://localhost:8080/ords/.

My goal is to have two server names like below:

Server Name Where to Proxy/Redirect Desired URL
dev.example.com http://localhost:8080/ords/ dev.example.com/f?p=4550
example.com http://localhost:8080/ords/folder/r/my_app example.com/my_app

This is the NGINX configuration I am using but it isn't working as desired:

server {
  server_name  dev.example.com;
  listen 80;

  access_log  /var/log/nginx/access.log;
  error_log   /var/log/nginx/error.log;

  rewrite ^/$ /$1 last;

  location / {
    proxy_pass http://localhost:8080/;    
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

server {
  server_name example.com;
  listen 80;

  access_log  /var/log/nginx/access.log;
  error_log   /var/log/nginx/error.log;

  rewrite ^/$ /ords/f?p=my_app last;

  location / {
    proxy_pass http://localhost:8080/;
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.