Discourse Rails as a proxy


(André Karge) #1

Hi,
I want to use my Discourse as a proxy.
For that the rails server should work as a proxy between the ember frontend and a registered remote URL.

Currently I am able to forward the HTTP response to ember and render it there.
But now I got some problems linking additional dependencies like images or stylesheets (all the stuff of the web root)

Here is an example flow diagram:

How can I make a link to these things such that the dependencies appear to be on my rails server for example in the web root?

Best regards.


(Robin Ward) #2

My first question is why? What are you trying to achieve here?

If you only need to forward certain routes, that’s more easily done in nginx or something that happens before your rails server is hit.


(André Karge) #3

Hi Robin, thanks for your answer.
I want to use Discourse as a wrapper for web applications. I thought this would be nice for startups in order to publish their web applications faster without wasting their time on user management, additional forum, social network and authentication.
The idea was to register the routes of your web application in a discourse plugin and render the content of the app inside discourse.


(Robin Ward) #4

It sounds like you’re trying to make Discourse do something it wasn’t designed to do. You’d have to register the routes in the ember side as well as the server side, plus have the server side set up a proxy. We’ve never done something like that before.