0

我正在尝试使用 ImageResizer s3Reader 插件来查看使用 ~/s3/ 前缀的非图像文件(PDF、ZIP)。在我的本地主机上,这工作得非常好,正如预期的那样。但是,一旦我将它部署到我的 beta 或生产环境,我就会收到一个 404 file not found 错误,适用于所有非图像。使用带有前缀 ~/s3/ 的 s3Reader 来查看图像在所有三种环境中都可以正常工作。我已经三重检查以确保我尝试访问的文件在 S3 上。

我找到的唯一解决方法是使用前缀http://s3.amazonaws.com/,但是客户要求不要使用它,因为它不利于 SEO。imageresizer 网站声称可以将 s3Reader 用于非图像文件。这是我的 resizer.debug 诊断返回的内容:

Image resizer diagnostic sheet      5/17/2013 3:59:30 PM

1 Issues detected:

(Warning):  To potentially see additional errors here, perform an image resize request.



You are using paid bundles: Performance Bundle, Cloud Bundle, Design Bundle

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.DiskCache.DiskCache
ImageResizer.Plugins.S3Reader.S3Reader
ImageResizer.Plugins.WhitespaceTrimmer.WhitespaceTrimmerPlugin
ImageResizer.Plugins.AdvancedFilters.AdvancedFilters
ImageResizer.Plugins.Basic.Presets
ImageResizer.Plugins.SeamCarving.SeamCarvingPlugin
ImageResizer.Plugins.Watermark.WatermarkPlugin
ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin

Configuration:

<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="DiskCache" />
<add name="S3Reader" buckets="subzerowolf" vpp="true" prefix="~/s3/" accessKeyId="[redacted]" secretAccessKey="[redacted]" />
<add name="WhitespaceTrimmer" />
<add name="AdvancedFilters" />
<add name="Presets" />
<add name="SeamCarving" />
<add name="Watermark" />
<add name="MvcRoutingShim" />
</plugins>
<diagnostics enableFor="AllHosts" />
<presets onlyAllowPresets="false">
<preset name="product-detail" settings="height=310;width=630;trim.threshold=80;trim.percentpadding=15" />
<preset name="category" settings="height=170;width=170" />
<preset name="catfallback" settings="height=310;width=630;trim.threshold=80;trim.percentpadding=15" />
<preset name="gallerythumb" settings="height=149;width=200;mode=crop;anchor=middlecenter;" />
<preset name="gallerylarge" settings="height=297;width=456;mode=crop;anchor=middlecenter;encoder=wic;quality=60" />
<preset name="gallerybg" settings="height=553;width=937;mode=crop;anchor=middlecenter;trim.threshold=80" />
<preset name="thumb" settings="height=138;width=138;mode=crop;anchor=middlecenter;encoder=wic;quality=60" />
<preset name="photodetail" settings="height=311;width=631;mode=crop;anchor=middlecenter;" />
<preset name="photodetailside" settings="height=50;width=50;mode=crop;anchor=middlecenter;" />
<preset name="zoomsm" settings="height=237;width=480;mode=crop;anchor=middlecenter;" />
<preset name="zoommed" settings="height=315;width=640;mode=crop;anchor=middlecenter;" />
<preset name="zoomlg" settings="height=505;width=1024;mode=crop;anchor=middlecenter;" />
<preset name="category-hero" settings="height=284;width=686;mode=crop;anchor=middlecenter;" />
<preset name="storypage-standard" settings="height=179;width=285;mode=crop;anchor=middlecenter;" />
<preset name="storypage-expanded" settings="height=585;width=877;mode=crop;anchor=middlecenter;" />
<preset name="storypage-interactive" settings="height=513;width=879;mode=crop;anchor=middlecenter;" />
<preset name="storypage-video" settings="height=397;width=879;mode=crop;anchor=middlecenter;" />
<preset name="storypage-gallery" settings="height=398;width=877;mode=crop;anchor=middlecenter;" />
<preset name="story-selector" settings="height=144;width=218;mode=crop;anchor=middlecenter;" />
<preset name="prod-list-single" settings="height=196;width=259;" />
<preset name="prod-list-double" settings="height=152;width=170;" />
<preset name="story-hero" settings="height=284;width=686;mode=crop;anchor=middlecenter;" />
<preset name="evidence-gallery" settings="height=398;width=877;mode=crop;anchor=middlecenter;" />
<preset name="accordian-image" settings="height=337;width=600;mode=crop;anchor=middlecenter;" />
<preset name="dlp-photo-preview" settings="height=400;width=600;mode=crop;anchor=middlecenter;" />
<preset name="feature-tooltip-image" settings="width=210;mode=crop;anchor=middlecenter;" />
<preset name="dlp-hero-gallery" settings="height=302;width=604;mode=crop;anchor=middlecenter;" />
<preset name="dlp-edu-block" settings="maxheight=280;mode=crop;anchor=middlecenter;trim.threshold=80;trim.percentpadding=5" />
<preset name="dlp-product-block" settings="maxheight=125;mode=crop;anchor=middlecenter;trim.threshold=80;trim.percentpadding=15" />
</presets>
<watermarks>
<text name="gmaplabel-single" text="#{num}" color="666666" fontSize="10" right="46%" bottom="52%" relativeTo="image" drawAs="overlay" />
<text name="gmaplabel-doubles" text="#{num}" color="666666" fontSize="10" right="39%" bottom="52%" relativeTo="image" drawAs="overlay" />
</watermarks>
</resizer>


Accepted querystring keys:

quality, format, thumbnail, trim.percentpadding, trim.threshold, blur, sharpen, a.blur, a.sharpen, a.oilpainting, a.removenoise, a.sobel, a.threshold, a.canny, a.sepia, a.equalize, a.posterize, a.contrast, a.brightness, a.saturation, a.truncate, a.balancewhite, a.balancethreshold, a.featheredges, preset, carve, watermark, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, 

Accepted file extensions:

bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, 

Environment information:

Running Microsoft-IIS/7.5 on Microsoft Windows NT 6.1.7601 Service Pack 1 and CLR 2.0.50727.5448
Trust level: Unrestricted
OS bitness: AMD64
Executing assembly: c:\windows\system32\inetsrv\w3wp.exe
IntegratedPipeline: True

Loaded assemblies:

mscorlib                                 Assembly: 2.0.0.0         File: 2.0.50727.5448  Info: 2.0.50727.5448
System.Web                               Assembly: 2.0.0.0         File: 2.0.50727.5710  Info: 2.0.50727.5710
System                                   Assembly: 2.0.0.0         File: 2.0.50727.5453  Info: 2.0.50727.5453
System.Xml                               Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Configuration                     Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Web.RegularExpressions            Assembly: 2.0.0.0         File: 2.0.50727.4927  Info: 2.0.50727.4927
System.Data                              Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Transactions                      Assembly: 2.0.0.0         File: 2.0.50727.4927  Info: 2.0.50727.4927
System.EnterpriseServices                Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Design                            Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Drawing                           Assembly: 2.0.0.0         File: 2.0.50727.5458  Info: 2.0.50727.5458
Microsoft.JScript                        Assembly: 8.0.0.0         File: 8.0.50727.4927  Info: 8.0.50727.4927
App_global.asax.-eux7gcy                 Assembly: 0.0.0.0        
SubZero.Web                              Assembly: 0.0.0.0        
System.Web.Extensions                    Assembly: 3.5.0.0         File: 3.5.30729.5446  Info: 3.5.30729.5446
System.Web.Abstractions                  Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
System.Core                              Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
System.Web.Routing                       Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
System.Web.Services                      Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Web.Mobile                        Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
AForge                                   Assembly: 2.2.4.0         File: 2.2.4.0        
AForge.Imaging                           Assembly: 2.2.4.0         File: 2.2.4.0        
AForge.Math                              Assembly: 2.2.4.0         File: 2.2.4.0        
AjaxControlToolkit                       Assembly: 3.0.20820.19484 File: 3.0.20820.0    
AjaxMin                                  Assembly: 4.42.4387.23950
Antlr3.Runtime                           Assembly: 3.1.0.39271    
AutoMapper                               Assembly: 0.4.0.126       File: 0.4.0.126       Info: 0.4.0.126
AWSSDK                                   Assembly: 1.5.15.0        File: 1.5.15.0       
Castle.Core                              Assembly: 1.1.0.0         File: 1.1.0.0         Info: 1.1.0.0
Castle.DynamicProxy2                     Assembly: 2.1.0.0         File: 2.1.0.0         Info: 2.1.0.0
Castle.MicroKernel                       Assembly: 2.0.0.0         File: 2.0.0.0         Info: 2.0.0.0
Castle.Windsor                           Assembly: 2.0.0.0         File: 2.0.0.0         Info: 2.0.0.0
CommonServiceLocator.WindsorAdapter      Assembly: 1.0.0.0         File: 1.0.0.0        
ConvertToExcel                           Assembly: 1.0.0.0         File: 1.0.0.0        
dbCommand                                Assembly: 1.0.2152.20583 
dotless.Core                             Assembly: 1.2.2.0         File: 1.2.2.0         Info: 1.2.2.0
DynamicSorting                           Assembly: 1.1.0.0         File: 1.0.0.0        
EcmaScript.NET.modified                  Assembly: 0.1.1.0        
FluentNHibernate                         Assembly: 1.0.0.594       Info: 1.0.0.594
FluentValidation                         Assembly: 1.2.0.0         File: 1.2.0.0        
FluentValidation.Mvc                     Assembly: 1.2.0.0         File: 1.2.0.0        
Gorilla.Utilities                        Assembly: 1.0.0.0         File: 1.0.0.0        
Iesi.Collections                         Assembly: 1.0.1.0         File: 2.1.1.4000      Info: 1.0
ImageResizer                             Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Mvc                         Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.AdvancedFilters     Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.DiskCache           Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.S3Reader            Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.SeamCarving         Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.Watermark           Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.WhitespaceTrimmer   Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
ImageResizer.Plugins.Wic                 Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317
Inflector.Net                            Assembly: 0.0.0.0        
InternetModel                            Assembly: 1.0.0.0         File: 1.0.0.0        
IP2Location                              Assembly: 1.6.2.18300    
itextsharp                               Assembly: 3.1.8.0        
JobOpening                               Assembly: 1.0.0.0         File: 1.0.0.0        
Jurassic                                 Assembly: 2.1.0.0        
KDC                                      Assembly: 1.0.0.0         File: 1.0.0.0        
KDC2008                                  Assembly: 1.0.0.0         File: 1.0.0.0        
LitS3                                    Assembly: 1.0.1.0         File: 1.0.1.0        
LocatorModel                             Assembly: 1.0.0.0         File: 1.0.0.0        
log4net                                  Assembly: 1.2.10.0        File: 1.2.10.0        Info: 1.2
MessageMedia                             Assembly: 2.2.1.265       File: 2.2.1.265      
Microsoft.Practices.ServiceLocation      Assembly: 1.0.0.0         File: 1.0.0.0        
Microsoft.Web.Mvc                        Assembly: 1.0.0.0         File: 1.0.40310.0    
MvcContrib.Castle                        Assembly: 1.0.0.99        File: 1.0.0.99        Info: 1.0.0.99
MvcContrib                               Assembly: 1.5.996.0       File: 1.5.996.0       Info: 1.5.996.0
MvcContrib.FluentHtml                    Assembly: 1.0.0.99        File: 1.0.0.99        Info: 1.0.0.99
Newtonsoft.Json                          Assembly: 3.5.0.0         File: 3.5.0.0        
NHibernate.ByteCode.Castle               Assembly: 2.1.1.4000      File: 2.1.1.4000      Info: 2.1.1.4000
NHibernate                               Assembly: 2.1.1.4000      File: 2.1.1.4000      Info: 2.1.1.4000
NHibernate.Validator                     Assembly: 1.2.0.2003      File: 1.2.0.2003      Info: 1.2.0.2003
NLog                                     Assembly: 1.0.0.0        
Payflow_dotNET                           Assembly: 4.3.0.0        
PostSharp.Core                           Assembly: 1.0.11.424     
PostSharp.Core.XmlSerializers            Assembly: 1.0.11.424     
PostSharp.Laos                           Assembly: 1.0.11.424     
PostSharp.Laos.Weaver                    Assembly: 1.0.11.416     
PostSharp.Public                         Assembly: 1.0.11.424     
PublicSiteDAL                            Assembly: 1.0.0.0         File: 1.0.0.0        
SharpArch.Core                           Assembly: 1.0.0.0         File: 1.0.0           Info: 1.0.0
SharpArch.Core.NHibernateValidator       Assembly: 1.0.0.0         File: 1.0.0           Info: 1.0.0
SharpArch.Data                           Assembly: 1.0.0.0         File: 1.0.0           Info: 1.0.0
SharpArch.Web.Castle                     Assembly: 1.0.0.0         File: 1.0.0           Info: 1.0.0
SharpArch.Web                            Assembly: 1.0.0.0         File: 1.0.0           Info: 1.0.0
SquishIt.Framework                       Assembly: 0.8.5.0         File: 0.8.5.0        
StandardDAC                              Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.ApplicationServices              Assembly: 1.0.0.0         File: 1.0.0.0         Info: 1.0.0.0
SubZero.App_Code                         Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Common.Business                  Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Common.DataAccess                Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Common.Entities                  Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Common.ViewModels                Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Core                             Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Data                             Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Public.Business                  Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Public.DataAccess                Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Public.Entities                  Assembly: 1.0.0.0         File: 1.0.0.0        
SubZero.Web.Controllers                  Assembly: 1.0.0.0         File: 1.0.0.0         Info: 1.0.0.0
sw.Common.Application                    Assembly: 1.0.0.0         File: 1.0.0.0        
sw.Common.Aspects                        Assembly: 1.0.0.0         File: 1.0.0.0        
sw.Common.Patterns                       Assembly: 1.0.0.0         File: 1.0.0.0        
sw.Web.Library.TradePanelSpecs           Assembly: 1.0.0.0         File: 1.0.0.0        
WorldDomination.Net.IPAddressExtensions  Assembly: 1.1.0.0         File: 1.1.0.0        
Yahoo.Yui.Compressor                     Assembly: 1.6.0.2         File: 1.6.0.2        
System.Runtime.Serialization             Assembly: 3.0.0.0         File: 3.0.4506.5420   Info: 3.0.4506.5420
System.IdentityModel                     Assembly: 3.0.0.0         File: 3.0.4506.5420   Info: 3.0.4506.5420
System.ServiceModel                      Assembly: 3.0.0.0         File: 3.0.4506.5420   Info: 3.0.4506.5420
System.ServiceModel.Web                  Assembly: 3.5.0.0         File: 3.5.594.5420    Info: 3.5.594.5420
System.WorkflowServices                  Assembly: 3.5.0.0         File: 3.5.594.5420    Info: 3.5.594.5420
System.Messaging                         Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Windows.Forms                     Assembly: 2.0.0.0         File: 2.0.50727.5446  Info: 2.0.50727.5446
ISymWrapper                              Assembly: 2.0.0.0         File: 2.0.50727.5420  Info: 2.0.50727.5420
System.Web.Mvc                           Assembly: 1.0.0.0         File: 1.0.40310.0    
System.Data.DataSetExtensions            Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
System.Xml.Linq                          Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
System.Data.Linq                         Assembly: 3.5.0.0         File: 3.5.30729.5420  Info: 3.5.30729.5420
Anonymously Hosted DynamicMethods Assembly Assembly: 0.0.0.0        
eotle1vi                                 Assembly: 2.1.1.4000     
q6ywobas                                 Assembly: 2.1.1.4000     
App_Web_vgohdmhx                         Assembly: 0.0.0.0        
App_Web__1nwwnf8                         Assembly: 0.0.0.0        
App_Web_-v1w9clr                         Assembly: 0.0.0.0        
App_Web_hqeztat1                         Assembly: 0.0.0.0        
Microsoft.VisualBasic                    Assembly: 8.0.0.0         File: 8.0.50727.5420  Info: 8.0.50727.5420

The following plugin assemblies are loaded but do not seem to be in use. You should remove them (and especially their dependencies (unless used elsewhere)) from the /bin folder to improve application load times:

ImageResizer.Plugins.Wic                 Assembly: 3.3.3.123       File: 3.3.3.123       Info: 3-3-3  Commit: c368317

Reference list of plugin dependencies - so you know what additional dlls to remove when removing a plugin. (may not be up-to-date, see plugin docs):

The FreeImage plugin has the following dependencies: FreeImage.dll and FreeImageNET.dll
The Logging plugin depends on: NLog.dll
The AdvancedFilters, RedEye, and WhitespaceTrimmer plugins depend on: AForge.dll, AForge.Math.dll, and AForge.Imaging.dll
The PsdReader and PsdComposer plugins depend on: PsdFile.dll
The S3Reader plugin depends on: LitS3.dll
The BatchZipper plugin depends on: Ionic.Zip.Reduced.dll
The PdfRenderer plugin depends on gsdll32.dll or gdsll32.dll
The RedEye plugin depends on several dozen files... see the plugin docs.

在这一点上,我很难过。我似乎已经正确配置了 s3Reader,并且我知道它具有读取文件的能力,因为我可以在 localhost 上查看它们。

4

1 回答 1

0

当某些东西在 localhost 上有效,但在生产环境中无效时,您就知道这是服务器配置问题。

您是否启用了RAMMFAR?如果 IIS 没有为所有请求加载 ASP.NET,它肯定不会获取非图像文件。

于 2013-05-17T19:24:22.273 回答