This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
/* | |
Copyright (c) 2011 Damien Antipa, http://www.nethead.at/, http://damien.antipa.at | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<title>Drag And Drop</title> | |
</head> | |
<body> | |
<div id="viz"></div> |
/** | |
* HandleBars remote template loader | |
* | |
* Allows for direct insertion into dom if jQuery selector string is passed (el). | |
* Returns $.ajax promise regardless so code can attach callbacks externally. | |
* | |
* @example | |
* // Direct insertion into dom | |
* Handlebars.renderFromRemote('/media/templates/hello.handlebars', { name: 'Ryan' }, '#content'); | |
* |
#!/usr/bin/env node | |
var jsdom = require('jsdom'); | |
var wikipedia = 'http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes'; | |
var jquery = 'http://code.jquery.com/jquery.js'; | |
jsdom.env(wikipedia, [jquery], function (errors, window) { | |
var $ = window.$; | |
var tds = $('table[class="wikitable sortable"] > tr > td'); | |
if (tds.size() % 10 != 0) { |
Warden::Manager.serialize_into_session{|user| user.id } | |
Warden::Manager.serialize_from_session{|id| User.get(id) } | |
Warden::Manager.before_failure do |env,opts| | |
# Sinatra is very sensitive to the request method | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block | |
env['REQUEST_METHOD'] = "POST" | |
end | |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
language: php | |
php: | |
- 5.3 | |
mysql: | |
database: drupal | |
username: root | |
encoding: utf8 | |
source 'http://rubygems.org' | |
gem 'rack' | |
gem 'rack-flash' | |
gem 'thin' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'mongoid' | |
gem 'bson_ext' | |
gem 'slim' |