My Rails應用程序使用ImageMagick,但應用程序嘗試執行ImageMagick命令(「識別」)時失敗。我在通過下面的環境變量在我的Apache配置固定在發展這個問題(在那裏我運行的Apache /乘客):如何將ImageMagick環境變量傳遞給nginx mongrels?
SetEnv MAGICK_HOME /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16
SetEnv DYLD_LIBRARY_PATH /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16/opt/local/lib
SetEnv PATH /usr/bin:/opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16/opt/local/bin
然而,我的生產環境中運行的Nginx和雜種(不是我成立),我不知道如何將這些變量傳遞給應用程序。我的nginx.conf文件目前如下:
# user and group to run as
user mouthbreather mouthbreather;
worker_processes 4;
# pid of nginx master process
pid /var/run/nginx.pid;
events {
worker_connections 8192;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/engineyard/nginx/access.log main;
error_log /var/log/engineyard/nginx/error.log notice;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/sites/*.conf;
}
所以我的問題是:
- 我怎麼能確定在哪裏我MAGICK_HOME是生產?
- 如何通過nginx.conf將這些變量傳遞給應用程序?
謝謝!