Skip to content

Instantly share code, notes, and snippets.

@pulse00
Created May 9, 2014 19:57
Show Gist options
  • Save pulse00/5abc2a3d61ad728471a2 to your computer and use it in GitHub Desktop.
Save pulse00/5abc2a3d61ad728471a2 to your computer and use it in GitHub Desktop.
user vagrant vagrant;
worker_processes 1;
error_log /var/log/nginx/error.log info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
sendfile on;
keepalive_timeout 65;
# we have plenty of vhosts
server_names_hash_bucket_size 64;
# upload progress
upload_progress proxied 1m;
client_max_body_size 0;
client_body_buffer_size 1024M;
# redirect non ssl to ssl
server {
listen 80;
location / {
rewrite ^(.*) https://upload.example.com$1 permanent;
}
}
server {
server_name upload.example.com;
listen 443 ssl;
ssl_certificate example.com.crt;
ssl_certificate_key example.com.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
#audio storage
location ~ ^/storage(\d)\/audio\/(.*)?$ {
alias /vagrant/example.com/current/web/files/storage$1/audio/$2;
}
# waveform storage
location ~ ^/storage(\d)\/waveform\/(.*)?$ {
alias /vagrant/example.com/current/web/files/storage$1/waveform/$2;
}
location / {
root /vagrant/example.com/current/web;
index frontend.php index.html index.htm;
try_files $uri $uri/ /frontend.php?q=$uri&$args;
}
location ^~ /progress {
# report uploads tracked in the 'proxied' zone
upload_progress_json_output;
report_uploads proxied;
}
location ~* (frontend|frontend_dev)\.php(/|$) {
root /vagrant/example.com/current/web;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index frontend.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
track_uploads proxied 30s;
fastcgi_temp_file_write_size 10m;
fastcgi_busy_buffers_size 512k;
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_intercept_errors on;
fastcgi_next_upstream error invalid_header timeout http_500;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment