Solved

Online port relay / redirect

Posted on 2013-06-14
7
541 Views
Last Modified: 2013-06-28
Hi,

Does anyone know if there is some sort of script that allows to redirect a port?

Basically, my home ISP does not allow ports below 1024 to be forwarded by their router.
My work blocks almost every port.
I do have a VPS where I would like to run something that listens let's say on some specific subdomain on port 80, but basically "proxies" all traffic to another IP and another port.

I tried a php proxy script, but it doesn't really do the job.

the vps is a windows machine with php support.
there are also some other sites already running on that machine, listening to specific subdomains, so these must keep working.
0
Comment
Question by:joachimcarrein
  • 4
  • 3
7 Comments
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 39249093
0
 
LVL 4

Author Comment

by:joachimcarrein
ID: 39257093
Hey aarontomosky,

I started looking into the iis Application Request routing. It does seem promising, but I seem unable to set it up correctly without messing up all my other websites.

When I want to create an URL rewrite, I need to enable the mark on "Use URL Rewrite to inspect incoming requests" which means I need to supply a reverse proxy. But I have no idea what that is...
If I set the reverse proxy to my destination, every site hosted on the machine gets redirected there...

I tried adding a rewrite module like this:
rewrite ^subdomain.domain.com(.*) to someotherdomain.com:8081
but this seems to have no effect.

Would you be able to assist me in further setup of this?
0
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 39257180
I have this exact setup at my office. Ill be there tomorrow and can give you exact directions if no one else pops up first.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 4

Author Comment

by:joachimcarrein
ID: 39270613
Hey aarontomosky,

Did you find the time to check your setup yet :)
0
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 39272177
sorry about the delay, It completely slipped my mind.
Here is my web.config that takes whatever comes to this site (it's bound to company.com:8081) and sends it out company.com:8080 which is another site on the same box

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://company.com:8080/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Open in new window

0
 
LVL 4

Author Comment

by:joachimcarrein
ID: 39277216
Hey aarontomosky,

I changed the rewrite url to my remote url, but nothing seems to happen actually.
is this an address rewrite rule or an internal request routing?

Regards
0
 
LVL 38

Accepted Solution

by:
Aaron Tomosky earned 500 total points
ID: 39278369
Make a new site in IIS. Bind it to whatever you want as the face of the proxy. Lets call it proxy.company.com:8081
Put that web.config in that site with the URL changed to let's call it remote.company.com:8080

So if you can't hit 8080, you can go to proxy.company.com:8081 and get the other site, effectively bypassing the port block.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now