Hide port 8383 in glassfish 3.1.2

喜你入骨 提交于 2019-12-11 16:53:25

问题


I am running Glassfish 3.1.2 on Linux 6 server to deploy Oracle Apex.

I want to to hide port 8383 from url (current url say : https://sd1.domain.com:8383/apex)

80 and 443 port are already assigned for another service.

So, how can I hide port 8383 from URL.


回答1:


A TCP connection is between two ip:port pairs. In case the server's port is a common one like 80/443, most browsers don't display it.

You can use a reverse proxy on port 80, that classifies incoming HTTP traffic. It could check the subdomain in the HTTP header and then forward traffic to one of the two web servers (which both listen on dedicated ports).

With nginx the config file could look like this:

server { 
  server_name sd1.domain.com;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://localhost:8383;
  }
}

server { 
  server_name www.domain.com;

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


来源:https://stackoverflow.com/questions/35240376/hide-port-8383-in-glassfish-3-1-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!