Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running an webapp on http://localhost:4020/
I proxy some requests from it to my apache server running on http://localhost:80

But instead of the file I want I get this error message:
Client sent malformed Host header because the Host header of the request (it is set to localhost:4020).

How to allow localhost:4020 to access the file?

share|improve this question
1  
Post the relevant parts of your Apache configuration. –  Seventoes Feb 7 '12 at 10:28
    
The Apache has a standard configuration (mac OS). Which information is necessary? The app on port 4020 is run on the sproutcore test server (sc-server). –  czerasz Feb 7 '12 at 11:49
    
I'd suggest that the starting point would be to set the Host header correctly in your 'webapp'. The host header should not be 'localhost:4020' - it is the name of the domain requested (without a port), and should be passed as part of the incoming HTTP request. Describe how you are proxying from localhost:4020 to Apache - and include relevant code and configs. –  cyberx86 Feb 7 '12 at 15:06
    
I don't know how the proxy in the sproutcore test server works (I know that it's written in ruby). That is why I wanted to do it with Apache. It is only for development purposes. –  czerasz Feb 7 '12 at 15:38
1  
I suppose the problem here is that you have two parts that need to work together. Apache needs to be able to serve the file - but your web app needs to be able to communicate with Apache in a way that Apache can understand. Right now, Apache is telling you that it doesn't understand what your web app is asking for. While that could be an Apache problem, in this case, it seems more likely that it is a problem with the front-end app. Verify that Apache can handle the request (i.e. directly request the page from Apache, bypassing your web app), so that you can either rule it out or focus on it. –  cyberx86 Feb 7 '12 at 17:07
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.