Created
April 26, 2010 22:48
-
-
Save zachseifts/380062 to your computer and use it in GitHub Desktop.
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
server { | |
listen 22.22.22.22:80; | |
server_name www.mysite.com; | |
rewrite ^/(.*) http://mysite.com/$1 permanent; | |
} | |
server { | |
listen 22.22.22.22:80; | |
server_name mysite.com; | |
access_log /var/log/nginx/mysite.com.access.log; | |
error_log /var/log/nginx/mysite.com.error.log; | |
location / { | |
proxy_pass http://mysite; | |
include /etc/nginx/proxy.conf; | |
} | |
location /static { | |
autoindex on; | |
access_log off; | |
expires 24h; | |
alias /home/www/mysite/mysite/media; | |
} | |
} |
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 www; | |
worker_processes 2; | |
error_log /var/log/nginx/error.log info; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} | |
http { | |
server_names_hash_bucket_size 64; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format main '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log /var/log/nginx/access.log; | |
client_header_timeout 3m; | |
client_body_timeout 3m; | |
send_timeout 3m; | |
client_header_buffer_size 1k; | |
large_client_header_buffers 4 4k; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 75 20; | |
## Compression | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_comp_level 2; | |
gzip_proxied any; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; | |
gzip_types text/plain text/html text/css application/x-javascript \ | |
text/xml application/xml application/xml+rss text/javascript \ | |
image/gif image/jpeg image/png; | |
# Some version of IE 6 don't handle compression well on some mime-types, | |
# so just disable for them | |
gzip_disable "MSIE [1-6].(?!.*SV1)"; | |
# Set a vary header so downstream proxies don't send cached gzipped | |
# content to IE6 | |
gzip_vary on; | |
# proxy settings | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_max_temp_file_size 0; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 90; | |
proxy_read_timeout 90; | |
proxy_buffer_size 4k; | |
proxy_buffers 4 32k; | |
proxy_busy_buffers_size 64k; | |
proxy_temp_file_write_size 64k; | |
#proxy_cache_path /var/cache/nginx keys_zone=anonymous:60m; | |
upstream mysite { | |
server 127.0.0.1:8080; | |
} | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment