IIS 7 – Static Resource Or HttpHandler
This is probably a fundamental question concerning IIS 7. I currently have a website running on IIS 7 on my local machine. I’ve noticed that when I type in a URL of the form http://localhost/styles/default.css, my web browser will open up the css file in notepad. However, if I use an imaginary nonexistant file extension, IIS tries to hand off the request to my website, which happens to be an asp.net mvc application. Because the [...]
Continue Reading »Serve different files for specific user agents using nginx
Using nginx, how do you serve different static files for different user agents? For example, if the current user is using an iPhone, they should be served mobile_index.html, whereas all other user agents should be served browser_index.html. Found solution: server { listen 80; root /var/www; set $mobile_request ’0′; if ($http_user_agent ~ ‘iPhone’) { set $mobile_request ’1′; } location =/ { if ($mobile_request = ’1′) { rewrite ^ /mobile_index.html; } if ($mobile_request = ’0′) { rewrite [...]
Continue Reading »What is the best way to optimize a Windows Server 2008 box running IIS7 to serve only static files?
I would like to have our web applications pull static content (css, js, images) from a static file server running Windows Server 2008 and IIS7. What sort of optimizations would you make to the server for this single purpose? (Machine.config changes? Web.config changes? Special IIS7 setup or modules? What?) View instructions at Build a Custom IIS 7.0 Server. In part named Stripping Down the Server you will get server configuration that doesn’t serve anything and [...]
Continue Reading »Apache – Serving static files from different subdomain + machine
Here’s the scenario A site is running on this domain – www.someserver.com I’m going to host subdomain.someserver.com on my machine. Let’s say all the image files are under the directory ‘img‘. I don’t want to copy all their images to my machine. So what should be the Apache directive(s) that’ll map the request for an image, like http://subdomain.someserver.com/img/image.png to http://www.someserver.com/img/image.png On subdomain.someserver.com: Redirect /img http://www.someserver.com/img On www.someserver.com: AliasMatch (.*)$ /location/of/home/directory/$1 Check more discussion of this [...]
Continue Reading »Scaling a GIF hosting site
My friend runs a popular Youtube-to-GIF conversion site. Right now, he has converted 250,000 Youtube videos to GIFs (each video gets 6 thumbnails for 1.5m total GIF files) and serves about 80TB of bandwidth per month. His server is IO blocking — I’m not a guru admin, but it seems to be the harddrive seek time for non-sequential GIFs that’s clogging everything up. He has a server with 100tb.com for $300/mo, and it comes with [...]
Continue Reading »What are the advantages of using an image server?
An image server for static images and possibly other static files (css, js, etc). Are they only used for large/popular websites? Secondly, are they only really beneficial when the images undergo some sort of processing (e.g. resizing)? I’m not a server guy, so this is unfamiliar territory for me. I’m working with IIS. Are there major differences if it’s done on a subdomain (images.mywebsite.com) on the same server or on another separate machine. Using an [...]
Continue Reading »How to create a share folder for multiple domains on Dreamhost
I have a Virtual Private server with Dreamhost. I’m trying to create a shared folder that all of my domains can access. In the folder I’d like to put PHP classes, and even static files like javascripts. I’ve created a directory on the same level as my domain folders. I’d like to call a file via something like this… /home/username/shared/file.php. This isn’t working however for static files, and I’m hoping some magic (like .htaccess maybe) [...]
Continue Reading »What headers to add for most efficient file caching?
So I’ve this response header for static files on my nginx server. Cache-Control:max-age=2592000 Connection:keep-alive Date:Sat, 11 Dec 2010 22:28:13 GMT Expires:Mon, 10 Jan 2011 22:28:13 GMT Last-Modified:Sat, 11 Dec 2010 22:11:35 GMT Server:nginx/0.6.32 I think of removing the server signature to reduce the response size. What should I add in my server configuration to make the browser to use files not even making a request to server and overall make it as efficient as possible? [...]
Continue Reading »Why isn’t IIS serving my static CSS / JS files?
I added an ASP.NET MVC3 site to ISS (which was working fine in the debugger). When viewing the site in a browser, everything appeared to be working fine except that all of the CSS and JS files were returning a 404. Here is the site in IIS Manager: Other details: OS: Windows Vista Home Premium 32-bit (with SP2) IIS: 7.0.6000.16386 Visual Studio 2010 Express with SP1 It sounds like a permissions error. Did you remember [...]
Continue Reading »nginx static content
I have a following deployed scenario. 1x nginx as frontserver for gzip and ssl ofload serving all request to the same server haproxy service listening on 127.0.0.1:8000 to do loadbalancing for three backend IIS webservers. Now I would like to move all the static content from my backend IIS server (css, jpg, png, js…)to one or two backend Nginx servers, to release working load of IIS. I guess I have to put another rule for [...]
Continue Reading »Recent Posts
- Windows File Permissions and Attributes
- What is the easiest way to upgrade my existing Perl 5.14 to Perl 5.16 on FreeBSD 9 using the ports system?
- Know if mysql has done its job
- Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change
- Why is it a bad idea to use customer email as from address



