# Rewrite from proxy backend with java applet

**URL:** <https://www.ruby-forum.com/t/rewrite-from-proxy-backend-with-java-applet/159491>\
**Category:** NGINX\
**Created:** [February 5, 2009, 1:42am UTC](https://www.ruby-forum.com/t/rewrite-from-proxy-backend-with-java-applet/159491 "2009-02-05T01:42:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@paul](https://www.ruby-forum.com/u/paul)\
**Post date:** [February 5, 2009, 1:42am UTC](https://www.ruby-forum.com/t/rewrite-from-proxy-backend-with-java-applet/159491/1 "2009-02-05T01:42:07Z")

</div>

I am having a proxy issue that seems to be a java problem…

We have a config that listens on port 10000 https and then proxies https  
to the backend on port 443. This works fine until I try and bring up a  
java applet which promptly tries to connect to port 443 instead of  
10000. Is there a way to rewrite the information the backend is sending  
to the java  
applet to make it connect to port 10000 instead of 443?

Thanks

---

<div class="post-metadata">

**Author:** ![paul](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@paul](https://www.ruby-forum.com/u/paul)\
**Post date:** [February 5, 2009, 8:25am UTC](https://www.ruby-forum.com/t/rewrite-from-proxy-backend-with-java-applet/159491/2 "2009-02-05T08:25:55Z")

</div>

On Wed, Feb 04, 2009 at 07:31:56PM -0500, Paul wrote:

> I am having a proxy issue that seems to be a java problem…
> 
> We have a config that listens on port 10000 https and then proxies https  
> to the backend on port 443. This works fine until I try and bring up a  
> java applet which promptly tries to connect to port 443 instead of  
> 10000. Is there a way to rewrite the information the backend is sending  
> to the java  
> applet to make it connect to port 10000 instead of 443?

If this is caused by redirect returned by backend, then try

[http://wiki.codemongers.com/NginxHttpProxyModule#proxy\_redirect](http://wiki.codemongers.com/NginxHttpProxyModule#proxy_redirect)

proxy\_redirect [https://backend/](https://backend/)[https://frontend:10000/](https://frontend:10000/);

or simply

proxy\_redirect [https://backend/](https://backend/) /;

---

<div class="post-metadata">

**Author:** ![paul](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@paul](https://www.ruby-forum.com/u/paul)\
**Post date:** [February 5, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/rewrite-from-proxy-backend-with-java-applet/159491/3 "2009-02-05T15:12:34Z")

</div>

But the nginx is only listening on port 10000 , not 443, the backend  
sends some URL for the java applet that makes it  
connect to 443 instead of 10000 … I’m trying to figure out what that  
is… Will this intercept something from the backend?

Right now I have it set up like this:  
server  
{  
listen 1.1.1.1:10000;  
ssl on;  
ssl\_certificate  
/usr/local/nginx/conf/abc.crt;  
ssl\_certificate\_key  
/usr/local/nginx/conf/abc.key;  
location /  
{  
proxy\_pass [https://10.150.42.112](https://10.150.42.112);  
proxy\_redirect [https://10.150.42.112/](https://10.150.42.112/)  
https://$http\_host/;  
proxy\_redirect default;  
}  
}
