logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Need help wrapping my head around Apache Proxying.
Author
surfrock66



Joined: 26 Jan 2017
Posts: 1
Location: USA, Elk Grove

PostPosted: Fri 27 Jan '17 2:05    Post subject: Need help wrapping my head around Apache Proxying. Reply with quote

I've been working for some time with a weird setup, and I believe proxying can solve some of my problems, but no matter how much I read I'm having trouble wrapping my head around the configuration. I'm hoping someone here can shed some light on if this is possible, and if so, how it would work.

To start, I have a hosted domain, http:// surfrock66 . com (spaces to not link in an attempt to not spam). On there, I have a subdomain which points to my house, and that subdomain's redirect is handled through the cpanel API on a script from my home server. That subdomain is http:// hda . surfrock66 . com.

Of note, I have a GeoTrust ssl cert for that subdomain. Any subfolder on that domain, for example, https:// hda . surfrock66 . com / torquetest . This will matter more later on.

I also have some services on alt ports. The one that comes to mind is netdata, which is on http:// hda . surfrock66 . com : 19999 . I want to put this behind a password AND enforce SSL over it. I've seen a guide to do this here: https://blog.ueffing.net/post/2016/04/03/how-to-install-firehol-netdata-on-a-linux-ubuntu-14-04-box-and-run-it-behind-an-apache2-proxy-with-basic-auth-protection/

That involves setting up a site as a virtualhost. The virtualhost is a subdomain, so it would be something like "http:// netdata . hda . surfrock66 . com". I would prefer to have "http:// hda . surfrock66 . com / netdata" direct there. Is proxying like that to a subdirectory possible, and if so, what does the sites-available file need to look like? I tried a bunch of stuff, but when I did "apachectl configcheck" failed in a myriad of ways.

Final question...if I get that configured correctly, a rule to enforce pushing ssl should work with my existing cert, correct?

Thanks for any help!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 10 Feb '17 18:57    Post subject: Reply with quote

Force SSL in a vhost is easy. Just a have a vhost on port 80 with the same name and redirect it to the other vhost.

netdata in a subfolder is easy.

Code:
   ProxyRequests Off
   ProxyPass "/netdata" "http://127.0.0.1:19999/" connectiontimeout=5 timeout=30
   ProxyPassReverse "/netdata" "http://127.0.0.1:19999/"
   RewriteEngine On
   RewriteRule ^/netdata$ http://%{HTTP_HOST}/netdata/ [L,R=301]
</VirtualHost>
Back to top


Reply to topic   Topic: Need help wrapping my head around Apache Proxying. View previous topic :: View next topic
Post new topic   Forum Index -> Apache