LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-18-2017, 08:52 AM   #1
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Rep: Reputation: 21
Reverse SSL proxy for Apche Tomcat


Dear Experts,

I'm trying to access a Tomcat server via Apache 2.4, configured as a reverse proxy server. All communication should take place using HTTPS.

On the reverse proxy I've installed the proper certificates and setup the forwarding to the tomcat server. However, whenever I try to access it, I get the following error message:
Code:
HTTP Status 500 - None of SP's internal[https://digsvw164.xxxxx.local:8100/dispatcher] and external address[[https://sb1web.xxxxx.nl:8100/dispatcher]] haven't been found in value of the "x-forwarded-for" header [172.29.38.10]
Where 172.29.38.10 is the IP address of the machine I'm coming from. If I access the tomcat server directly all is fine.

My apache configuration for this host is:
Code:
<VirtualHost *:8100>
    ServerAdmin                support@xxxxx.nl
    ServerName                 sb1web.xxxxx.nl
    SSLEngine                  on
    SSLProtocol                all -SSLv2 -SSLv3
    SSLCipherSuite             ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!MD5:@STRENGTH
    SSLCertificateFile         /etc/apache2/ssl.crt/xxx_nl.crt
    SSLCertificateKeyFile      /etc/apache2/ssl.key/xxx_nl.key
    SSLCertificateChainFile    /etc/apache2/ssl.crt/xxx_nl.ca-bundle
    SSLProxyEngine             On
    SSLProxyVerify             none
    SSLProxyCheckPeerCN        off
    SSLProxyCheckPeerName      off
    SSLProxyCheckPeerExpire    off
    ProxyRequests              On
    ProxyPreserveHost          Off
    ProxyBadHeader             Ignore
    ProxyPass                  / https://172.29.38.164:8100/ retry=0 timeout=5 KeepAlive=on
    ProxyPassReverse           / https://172.29.38.164:8100/
</VirtualHost>
I also tried fiddling around with directives like
Code:
    RemoteIPHeader             X-Forwarded-For
    RemoteIPInternalProxy      172.29.38.0/24
in various forms, but all to no avail.

Any help would be greatly appriciated.
 
Old 01-20-2017, 09:55 AM   #2
Coffee!!!
LQ Newbie
 
Registered: Dec 2016
Distribution: RHEL
Posts: 18

Rep: Reputation: Disabled
You're proxy configuration is incorrect (you only need 3 things for a reverse proxy to work, unless you have some really odd information passed in headers):

ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / https://websitename.nl/

I use this on my servers that host Tomcat based applications to secure the front end with Apache web server and it works like a charm.
 
Old 01-20-2017, 10:03 AM   #3
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by Coffee!!! View Post
You're proxy configuration is incorrect (you only need 3 things for a reverse proxy to work, unless you have some really odd information passed in headers):

ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / https://websitename.nl/

I use this on my servers that host Tomcat based applications to secure the front end with Apache web server and it works like a charm.
Hi,

Thanks for your suggestions. But I my case I also need the reverse proxy to take care of the certificate handling for me. That's basically the reset of the configuration in there. Also, I need the ServerName directive. The reverse proxy handles many more hosts, so I need it to determine to what host to send the request.

But I notice that you have
Code:
ProxyPreserveHost On
where I have it set to Off. I'll change that and see if it does the trick for me.
 
Old 03-18-2017, 03:22 AM   #4
Guino
LQ Newbie
 
Registered: Mar 2017
Posts: 1

Rep: Reputation: Disabled
Same Reverse Proxy Issue

Hello lpwevers,

I notice that you try to publish SAP B1 Browser Access on Internet using Apache Reverse proxy.
I am currently trying to do the same thing and i have the same errors you mentionned.

Did you finally find a way to solve the issue ?

Guillaume
 
Old 08-25-2022, 03:24 AM   #5
mkLnxAdm
LQ Newbie
 
Registered: Aug 2022
Posts: 3

Rep: Reputation: 0
Hello lpwevers,

I have a similar problem with SAP B1 just like Guino

Were you able to solve it and access the site correctly?


Kind regards
mkLnxAdm
 
Old 08-25-2022, 11:09 AM   #6
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
I think it is checking the URL, so you need to pass it:

ProxyPassReverse / https://sb1web.xxxxx.nl:8100 and not


If you use Preserve, I think it will pass: https://sb1web.xxxxx.nl

could be wrong, it might work.
 
Old 08-26-2022, 05:44 AM   #7
mkLnxAdm
LQ Newbie
 
Registered: Aug 2022
Posts: 3

Rep: Reputation: 0
So you suggest turning ProxyPreserveHost Off?
 
Old 08-26-2022, 08:27 AM   #8
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
I would, and control from ProxyPassReverse.

Your app is checking for 2 names, I don't know the distinction between internal and external. Obviously by the naming of the internal it seems to be the way to call it locally.

https://digsvw164.xxxxx.local:8100 https://sb1web.xxxxx.nl:8100

Since Cert checking is off, either might work.
 
Old 08-28-2022, 03:02 AM   #9
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by mkLnxAdm View Post
Hello lpwevers,

I have a similar problem with SAP B1 just like Guino

Were you able to solve it and access the site correctly?


Kind regards
mkLnxAdm
Hi,

Well to be honest, I don't remember; it's been 5 years since I had this issue and we're not using SAP B1 anymore. I do however, very vaguely recall that the only option was to switch to ngnix instead of Apache.

Kind regards,
Louis
 
Old 08-29-2022, 02:55 AM   #10
mkLnxAdm
LQ Newbie
 
Registered: Aug 2022
Posts: 3

Rep: Reputation: 0
Hello,

yeah 5 years is a long time but still thanks for your reply

I'll probably need to switch to nginx too because that's the proxy SAP recommends.

Kind regards,
mkLnxAdm
 
Old 08-29-2022, 07:38 AM   #11
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
You can see how has more straightforward proxy "masquerading" directives in this link:


https://www.supereasy.com/how-to-con...-proxy-easily/

It is the same problem; you have to pass the right values to the proxied internal server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse Proxy - Frontend - Tomcat (Suggestions?) Orangutanklaus Linux - Server 0 08-30-2013 12:44 PM
Apache2 SSL Reverse Proxy doublejoon Linux - Networking 4 08-04-2011 09:29 AM
SSL Reverse Proxy? Or what am I after? helptonewbie Linux - Newbie 5 01-18-2011 04:01 PM
reverse proxy & tomcat goldwing Linux - Server 5 10-08-2010 03:15 PM
SSL reverse proxy sci3ntist Linux - Server 10 12-27-2009 01:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration