Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Online port relay / redirect

Posted on 2013-06-14
7
Medium Priority
?
626 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:Joachim Carrein
  • 4
  • 3
7 Comments
 
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 39249093
0
 
LVL 4

Author Comment

by:Joachim Carrein
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 39

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:Joachim Carrein
ID: 39270613
Hey aarontomosky,

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

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:Joachim Carrein
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 39

Accepted Solution

by:
Aaron Tomosky earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

916 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