The app works perfectly on localhost.  I just want to use a reverse proxy as a 
deployment option.  I'm putting the Google Maps API Key and the Currencylayer 
API Access Key in environment variables.  The app uses Google Maps as the GUI, 
so of course if the API Key doesn't make it to the HTML file, the app won't 
show up and all you'll see is a Google Maps error page talking about an invalid 
Google Maps API Key.  The currency conversion form is on the info window on the 
map, so unless I get this to work first, I can't test anything else to see if 
it's working.  But yeah, again, it works perfectly on localhost; it's a 
currency conversion app using a Google Map as its GUI whose backend app is 
itself a web server (written in C++ and compiled using the MSVC compiler; it's 
a Windows executable).  I could've used a VPS as well, but I'm on a budget.


I declare the variables holding those keys in the C++ code itself, so I really 
just need to get them to the frontend code.  So I probably need Apache to be 
able to see them as well and put them where they need to be on the frontend 
side.  I already make an AJAX request in the JavaScript code for the 
Currencylayer API Access Key and also use the Jinja2Cpp library for the HTML 
file; I send the the Google Maps API Key to it as the response to the client 
code when it asks for the HTML file.


After getting this to work, I need to know how to set up the reverse proxy and 
virtual host for my app on my Windows 10 PC.

________________________________
From: Eric Covener <cove...@gmail.com>
Sent: Sunday, September 9, 2018 6:49:11 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Reverse Proxy for Web Application (or adding it as 
extension to Apache web server)

On Sat, Sep 8, 2018 at 9:37 PM Osman Zakir <osmanzaki...@hotmail.com> wrote:
>
> I already attached the code in an earlier message.  If you want to know what 
> my application does and what the server I wrote is doing, please read the 
> code.  I also explained it in comments in the code, including at the very top 
> of the C++ and JavaScript files.

That's asking a lot.

> What I copied over were the HTML, CSS, JavaScript and .exe files, as well as 
> some other files required for the application that Visual Studio created 
> (currency_converter.ipbd, currency_converter.iobj, currency_converter.pdb), 
> when I compiled and linked under the Release build configuration.

Did you disable the reverse proxy config?  I'm surprised you "only"
had environment variable problems.  Or did it not work at all and this
is just an unnecessary tangent?

> If I go back to the reverse proxy route, I'd have to take out the environment 
> variables I guess.
This relationship doesn't make sense.  If you had no proxy, you'd set
environment variables your backend server could see.  Adding a reverse
proxy doesn't change anything.


>(unless there's a way to hide the Google Maps API Key and the currency API 
>Access Key that I can use with a reverse proxy in Apache, so that I don't have 
>put the keys in there directly--is there something like this?).

Hide from who?

> Either way, I do still need to know how to configure the vhosts configuration 
> file (and the reverse proxy configuration in the httpd.conf file if I do go 
> back to that--which I think I'll have to) so that when I navigate to the 
> virtual host in the browser, I'll see the application I made.

If you have a working backend service, and you put the bog-standard
Apache reverse proxy in front of it, what specifically in terms of the
request or response isn't working?
Putting a reverse proxy in front of a backend service that doesn't
work isn't going to make it start working.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to