13

I'm trying to enable proxy virtualhost:

<VirtualHost *:80>

  ServerName xxxxx.domain.tdl
  SSLProxyEngine On
  SSLProxyCheckPeerCN on

  ProxyPass / https://localhost:1234
  ProxyPassReverse / https://localhost:1234

</VirtualHost>

But i've an 500 err and my error.log (apache2) display:

[Tue Jan 03 15:41:42 2012] [error] (502)Unknown error 502: proxy: pass request body failed to [::1]:1234 (localhost)

[Tue Jan 03 15:41:42 2012] [error] proxy: pass request body failed to [::1]:1234 (localhost) from 82.252.xxx.xx ()

Missing some parameters ?

bux
  • 606
  • 2
  • 6
  • 20

3 Answers3

3
ProxyPass / https://localhost:1234/
ProxyPassReverse / https://localhost:1234/

Try that instead. Slashes matching is important.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • 1
    Hello, same error with slashes. – bux Jan 03 '12 at 17:30
  • 5
    Ok. Is the service on port 1234 actually listening on IPv6? Try `127.0.0.1` instead of `localhost`. Also, what's the subject name of the certificate on that port? If it's not an exact match with that hostname, the connect will fail - and if you make the change to force IPv4 localhost (127.0.0.1) then it'll really fail. Probably just turn off `SSLProxyCheckPeerCN`. – Shane Madden Jan 03 '12 at 17:40
  • "Probably just turn off SSLProxyCheckPeerCN": Yes, it's working now =). But now the service behind localhost:1234 throw an error about cookies :/ (Your browser does not support cookies, which are required for this web server to work in session authentication mode) I think its the ProxyPass, service work fine without it. – bux Jan 03 '12 at 18:30
  • didn't helped for me, any other ideas? – childno͡.de Dec 19 '12 at 00:01
  • @childno.de It'd be best if you open a new question with your specific configuration and log entries so that we can take a look at that. – Shane Madden Dec 19 '12 at 02:06
3

If the browser is setting the cookies for xxxxx.domain.tdl and the server is returning them for localhost or a locally defined domain, you might have a mismatch. You can use ProxyPassReverseCookieDomain to rewrite the cookies.

Since they're both on /, you probably won't need ProxyPassReverseCookiePath.

Brad Ackerman
  • 2,141
  • 2
  • 17
  • 19
Bill McGonigle
  • 647
  • 5
  • 8
2

Use 127.0.0.1 instead of localhost, probably your app is not running IPv6

GioMac
  • 4,444
  • 3
  • 24
  • 41