在glassfish 3.1.2中隐藏端口8383 [英] Hide port 8383 in glassfish 3.1.2

查看:139
本文介绍了在glassfish 3.1.2中隐藏端口8383的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Linux 6 服务器上运行 Glassfish 3.1.2 来部署 Oracle Apex

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

我想从url中隐藏端口8383(当前网址说: https://sd1.domain.com:8383/apex

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

80和443端口是已经分配给另一个服务。

80 and 443 port are already assigned for another service.

因此,我怎样才能从URL中隐藏端口8383。

So, how can I hide port 8383 from URL.

推荐答案

TCP连接在两个ip:port对之间。如果服务器的端口是像80/443这样常见的端口,大多数浏览器都不显示它。

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.

您可以在端口80上使用反向代理, HTTP流量。
它可以检查HTTP头中的子域,然后将流量转发到两个网络服务器中的一个(这两个服务器都在专用端口上监听)。

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).

使用nginx配置文件可能如下所示:

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;
  }
}

这篇关于在glassfish 3.1.2中隐藏端口8383的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆