This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

port forward for http traffic cuts url

Hello!
my actual network setup for http traffic is the following:
Intranet –> Gateway (PFSense)--> Squid Proxy -> Internet
All Port 80 Traffic will be forwarded from the PFSense to the Squid by a NAT Port Forward rule. So the Squid is working transparent for the users.
I tried to replace the Squid proxy by the Sophos UTM (Intranet –> Gateway (PFSense)--> Sophos UTM -> Internet). 
If I set the Sophos UTM as proxy in the browser everything works very well but if I try to make a NAT Port Forward for HTTP traffic to the Sophos UTM I get the following error in the browser:
“An error occurred while handling your request
While trying to retrieve the URL:
/topic/325236-pfsense-and-nat 
The content could not be delivered due to the following condition:
Received invalid request from Client 
Your cache administrator is:”

The logs files said the following:

2014:01:05-16:44:30 *** httpproxy[4824]: id="0002" severity="info" sys="SecureWeb" sub="http" name="web request blocked" action="block" method="GET" srcip="192.168.2.1" dstip="" user="" statuscode="400" cached="0" profile="REF_DefaultHTTPProfile (Default Proxy)" filteraction=" ()" size="2631" request="0xdfd31b0" url="/local-language-forums/german-forum/46099-proxy-auto-config-funktioniert-nicht.html" exceptions="" error="Received invalid request from Client"

Very interesting is, that if I open the same website with the proxy set in the browser I get the following:

2014:01:05-16:47:50 *** httpproxy[4824]: id="0001" severity="info" sys="SecureWeb" sub="http" name="http access" action="pass" method="GET" srcip="192.168.2.110" dstip="85.115.22.9" user="" statuscode="200" cached="0" profile="REF_DefaultHTTPProfile (Default Proxy)" filteraction="REF_DefaultHTTPCFFAction (Default content filter action)" size="19178" request="0xdfd3330" url="www.astaro.org/.../46099-proxy-auto-config-funktioniert-nicht.html" exceptions="" error="" content-type="text/html"

It seems that something cuts the domain of the url….
Have anyone an idea how to fix this?

Regards
Alex


This thread was automatically locked due to age.
  • Hello, Alex, and welcome to the User BB!

    The cleanest would be 'Intranet –> Sophos UTM -> Internet', but I can understand that you would be hesitant to make so many changes.  In fact, you will find that it would be easier than the gradual change you're attempting.

    If you don't want to make that leap of faith, I think you will need to configure PfSense to use the UTM as an upstream proxy, but I don't know those details.

    Cheers - Bob
  • Hi Bob,

    thanks for your reply. 
    You are right, it would be possible to use a upstream proxy in pfsense. The problem is, that this needs a lot of system cpu, because i have to install a squid there. My idea is (already use this with Squid) to  make a NAT port forwarding to reduce the system load.
    And in this case i get these strange error (see first post). It seems the UTM handles some requests not correct...
    regards
    Alex
  • Hi, 

    NAT won't modify the URL, so something is going on with the proxy/proxies.

    Barry
  • This does not look like any behavior I've seen before from the UTM, I can only suspect the server, client and/or pfSense.  Let's step back and ask what you goals are.   

    Cheers - Bob  

    Sorry for any short responses.  Posted from my iPhone.
  • Hi Bob,
    the goal is very easy. I want replace my squid with havp by the UTM without replacing my pfsense...
    My idea was to rewrite the existing port forward rule pointing to the squid to the UTM....
    Regards Alex
  • Hi, run a sniffer between the PFSense and the UTM to see if the problem is there before the UTM.

    Barry
  • Hi Barry,
    i do some test with Wireshark.

    Test 1: NAT Port Forward - Error
      


    Test 2: Proxy set in Browser - everything OK


    I thing the problem is the GET request. If I make a Port Forward the host is not included in the "Request URI", its included in the "Host" field. 

    Maybe there is any change to configure the UTM to use the "Host" + "Request URI" if the "Request URI" doesn't include the host name? 
    I assume other proxy's like Squid do the same.

    Regards Alex
  • Hi, the port forward is on PFSense, right?

    Have you asked about it on their forums?

    Barry
  • Hi Barry,
    this not not a pfsens problem. The pfsense only forward the traffic. The problem ist that the proxy server needs to understand that it is not receiving a fully qualified absolute URI, but a relative URI. Normally, the proxy server receives http://domain.tld, but if the client thinks it's talking to the server, not a proxy, it just asks for /path. I think this is not really a bug because the proxy works like specified in RFC 2616 (see link) but it would be a nice feature request for the developers because many other proxys can handel this request.
    To read more details look at the RFC 2616 at section 5.1.2 RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1
    Regards
    Alex
  • I thing the problem is the GET request. If I make a Port Forward the host is not included in the "Request URI", its included in the "Host" field.

    You even said this in your first post, but we all missed the detail that you were using a NAT rule instead of a policy route in the pfSense.

    Another solution would be to put the UTM inside your intranet.  There, you still could use a policy route with the proxy in a Transparent mode, but you also could go to Standard mode.  In either mode, you could do this with a single NIC, leaving the pfSense with a public IP on its WAN interface.

    Cheers - Bob