Created
February 11, 2010 21:58
-
-
Save jbalogh/302011 to your computer and use it in GitHub Desktop.
Serving AMO media and add-on files from a local nginx.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
#access_log logs/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
#gzip on; | |
server { | |
listen 5000; | |
server_name localhost; | |
location / { | |
root /Users/jeff/dev/zamboni/; | |
autoindex on; | |
} | |
} | |
server { | |
listen 5001; | |
server_name localhost; | |
rewrite "collection_icon/(\d{1,3})/" /collection_icons/0/$1; | |
rewrite "collection_icon/((\d*?)\d{1,3})/" /collection_icons/$2/$1; | |
rewrite "addon_icon/(\d{1,3})/" /addon_icons/0/$1; | |
rewrite "addon_icon/((\d*?)\d{1,3})/" /addon_icons/$2/$1; | |
location / { | |
root /Users/jeff/dev/remora-images; | |
autoindex on; | |
if (-f $request_filename.png) { | |
rewrite (.*) $1.png last; | |
} | |
if (-f $request_filename.jpg) { | |
rewrite (.*) $1.jpg last; | |
} | |
if (-f $request_filename.gif) { | |
rewrite (.*) $1.gif last; | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEDIA_URL = 'http://localhost:5000/media//' | |
STATIC_URL = 'http://localhost:5001/' | |
ADDON_ICON_URL = STATIC_URL + 'addon_icon/%d/%s' | |
PREVIEW_THUMBNAIL_URL = STATIC_URL + 'previews/thumbs/%s/%d.png?modified=%d' | |
FILES_URL = STATIC_URL + 'downloads/file/%d/%s?src=%s' | |
COLLECTION_ICON_URL = STATIC_URL + 'collection_icon/%s/%s' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment