ruby on rails - nginx rewrite rules with Passenger -
I am attempting to migrate from Apache to NGN using the passenger in both instances to host the Railway app . The app makes a request, which is for an image - if the image / system / logo / $ is on the requested image, it should be served, or if it is necessary, to allow it to hit the rail app Rewrite code% {DOCUMENT_ROOT} / system / logo /% {REQUEST_FILENAME} -f rewrite rule ^
/ (where it is
*) $ Http://assets.clg.eve-metrics.com/system/logos/$1
This worked fine properties. Subdomains have other subdomains, but the same root Along with, the bus passenger is set to host special, static files (the expiry time).
In the NGN, I am using the following:
server {80; passenger active; Server_name clg.eve-metrics.com www.clg.eve-metrics.com; root / opt / www / CLG / current / public; on jeez; gzip_min_length 1000; gzip_proxied end No-Cash No-Store Private Oath; Gzip_types Text / Plain App / XML Text / CSS Application / JavaScript; G Zip_disable msie6; error_page 500 502 503 504 / 50x.html; Location = /50x.html {} if (-f $ document_root / system / logos $ request_filename) {rewrite ^ / (. *) $ Http://assets.clg.eve-metrics.com/system/logos/$1 Break; }}
It does not work so well; In fact, it does not actually redirect the cached path anytime and it does not hit the Rail app it seems like NGN It is a static asset, so it is not passing passenger. Is there a way to stop this behavior so that it can hit the app?
My Rail application is running on nginx and the passenger has given me the default / Public
to / public / system / cache /
To make it work, I had to put it in my vhost config file:
If (-f $ document_root / system / cache / $ uri / index.html) {re-type (. *) /system/cache/$1/index.html break; } If (-f $ document_root / system / cache / $ uri.html) {re-type (. *) /system/cache/$1.html break; }
I remember that I even tried to work it with $ request_filename
, but it did not work to work instead of $ uri Try it with
and see if it works: -)
Comments
Post a Comment