WebFaction
Community site: login faq

I need to mash up several APIs from multiple custom applications, and only want to expose a subset of those APIs. For example, SOLR provides a mix of search (i.e. /solr/catalog/search) and administrative (i.e. /solr/admin) APIs. I only want the website to expose the search APIs, and I want the final website to expose those from multiple custom applications.

So far, the only WebFaction way I can do this (which works) is by creating a mod_wsgi application, which gives me direct access to httpd.conf and ProxyPass. But, I feel like this is overkill, since I'm not actually using mod_wsgi for anything, just having a set of static documents and a set of ProxyPass directives to mash up the various APIs from the other custom apps.

My solution works, but is there a more lightweight way to do this in WebFaction other than installing my own proxy? I've been considering lighttpd, but it's one more thing I need to maintain currency on.

UPDATED 2017-08-30:

I think my original question was unclear. Forget about multiple applications. I'm running SOLR as an application, and I want to map only two of its services to the website. Here's how I configured Apache to only expose those two services:

# Proxy for Solr select
<LocationMatch "/bookworm/solr/select">
    ProxyPass http://localhost:xxxxx/solr/shortstories/select
    ProxyPassreverse http://localhost:xxxxx/solr/shortstories/select
    Header add "Access-Control-Allow-Origin" "*"
</LocationMatch>

# Proxy for Solr mlt
<LocationMatch "/bookworm/solr/mlt">
    ProxyPass http://localhost:xxxxx/solr/shortstories/mlt
    ProxyPassreverse http://localhost:xxxxx/solr/shortstories/mlt
    Header add "Access-Control-Allow-Origin" "*"
</LocationMatch>

How do I map a website to specific URLs of an application? I can't disable the other APIs on SOLR, and I use them over SSL Tunnel, but I don't want them exposed to the public.

asked 30 Aug, 01:48

davidlday's gravatar image

davidlday
24
accept rate: 0%

edited 30 Aug, 21:50


We're already running Nginx as a front-end proxy for all customer sites.

So, you should be able to run your various back-end servers on dedicated ports (assigned via "Custom app (listening on port)" applications), attach them to your site config via our control panel, and our front-end Nginx will then proxy requests to them.

permanent link

answered 30 Aug, 19:19

seanf's gravatar image

seanf ♦♦
11.8k21333
accept rate: 37%

I tried doing what you suggested, but couldn't figure out how to make it only expose a subset of the APIs from the application. I think my original question is unclear, so I'm updating it with how I currently have it configured.

(30 Aug, 21:35) davidlday davidlday's gravatar image

Ok, if that's your goal then you definitely need to run a back-end proxy.

What you're already doing seems reasonable to me. If your concern is that you're loading mod_wsgi in Apache without needing it, then just remove that module (and any others that you don't need) from your httpd.conf.

If you'd prefer to use Nginx, then you can install a Passenger application from our control panel, and edit the included nginx.conf to your liking.

And, of course, you're free to build some other back-end HTTP server if you prefer that.

(30 Aug, 23:43) seanf ♦♦ seanf's gravatar image

Thanks, @seanf! I'm okay with how I'm doing it, and I did disable mod_wsgi. I was mostly concerned that I a) wasn't seeing something in the provided UI (and thus over complicating the situation) and b) that I would risk "breaking" something in the wsgi application setup by disabling it. Will mark as answered, but maybe it would help others if you edit your answer to draw attention to your comment somehow.

(01 Sep, 00:31) davidlday davidlday's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×24
×5
×4

question asked: 30 Aug, 01:48

question was seen: 133 times

last updated: 01 Sep, 00:31

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM