Welcome! Log In Create A New Profile

Advanced

Re: Rewrite: fixing Metadot Kluginess

July 23, 2009 03:14AM
On Thu, Jul 23, 2009 at 04:10:48AM +0200, Paul Hamann wrote:

> Greetings. I'm implementing portal software called Metadot. It was
> orginally Perl -- ported to Rails about 1 yr ago. There's a bunch of
> Perl-isms and silliness that makes it somewhat dependent on Apache2 /
> fcgi.
>
> I'm trying to use Nginx to proxy/balance dynamic requests to multiple
> Apache2/Passenger servers. I want Nginx to serve up all static content
> so that Aapche2 can serve just rails. They put attachments and images
> in a separate directory outside the rails root. Then they pre-pended
> the filename with 8 digits made up of zeros and the file's id. I want
> to rewrite specific file formats to their actual filenames and dirs.
>
> Example for user uploaded images. {png | ico | jpg | gif | etc.....}
>
> request comes in as: /__metadot__/image_library/image.gif
>
> maps to: ../../metadot-on-rails-attachments/00000001/00000022-image.gif
>
> 22 is the file id and image.gif is the [already unique] filename.
> metadot-on-rails-attachments is at the same level as the rails root, not
> inside it.
>
> Please help! I've been lost on this all day.

If only backend knows how to map URI to file system, you may
proxy such request to the backend and the backend should return

X-Accel-Redirect: /metadot-on-rails-attachments/00000001/00000022-image.gif

However, I prefer direct mapping without backend participation.


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Rewrite: fixing Metadot Kluginess

Paul Hamann July 22, 2009 10:10PM

Re: Rewrite: fixing Metadot Kluginess

Igor Sysoev July 23, 2009 03:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 230
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready