0

My application is found here:

http://my.app.com:3000/

My assets are found here:

http://my.app.com:3000/dev-assets

My application references assets here:

http://my.app.com:3000/assets

I'm using a local rails server thin which is already taking port 3000. Is it possible to use nginx to rewrite /assets/(.*?)$ to /dev-assets/$1 under the same port, or am I approaching this completely wrong?

1 Answer 1

0

In short, you need to change the port thin is listening right now. For example, it can be port 9000. Next, you create nginx config for my.app.com; specify port 3000. Then, all serve all requests to /assets into folder dev-assets on your filesystem (see root derective).

All other requests get passed (proxied) to localhost:9000.

Here is the sample nginx config illustrating mongrel integration (it doesn't matter which application server is listening the port): http://brainspl.at/nginx.conf.txt

Be sure to check out thin usage manual: http://code.macournoyer.com/thin/usage/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .