merge. i thinkkk.
This commit is contained in:
commit
8555508338
41
nginx.conf
41
nginx.conf
|
@ -19,16 +19,6 @@ events {
|
||||||
# your OS, and this is probably the point at where you hire people
|
# your OS, and this is probably the point at where you hire people
|
||||||
# who are smarter than you, this is *a lot* of requests.
|
# who are smarter than you, this is *a lot* of requests.
|
||||||
worker_connections 8000;
|
worker_connections 8000;
|
||||||
|
|
||||||
# This sets up some smart queueing for accept(2)'ing requests
|
|
||||||
# Set it to "on" if you have > worker_processes
|
|
||||||
accept_mutex off;
|
|
||||||
|
|
||||||
# These settings are OS specific, by defualt Nginx uses select(2),
|
|
||||||
# however, for a large number of requests epoll(2) and kqueue(2)
|
|
||||||
# are generally faster than the default (select(2))
|
|
||||||
# use epoll; # enable for Linux 2.6+
|
|
||||||
# use kqueue; # enable for *BSD (FreeBSD, OS X, ..)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Change these paths to somewhere that suits you!
|
# Change these paths to somewhere that suits you!
|
||||||
|
@ -52,7 +42,7 @@ http {
|
||||||
|
|
||||||
# ~2 seconds is often enough for HTML/CSS, but connections in
|
# ~2 seconds is often enough for HTML/CSS, but connections in
|
||||||
# Nginx are cheap, so generally it's safe to increase it
|
# Nginx are cheap, so generally it's safe to increase it
|
||||||
keepalive_timeout 5;
|
keepalive_timeout 20;
|
||||||
|
|
||||||
# You usually want to serve static files with Nginx
|
# You usually want to serve static files with Nginx
|
||||||
sendfile on;
|
sendfile on;
|
||||||
|
@ -60,12 +50,12 @@ http {
|
||||||
tcp_nopush on; # off may be better for Comet/long-poll stuff
|
tcp_nopush on; # off may be better for Comet/long-poll stuff
|
||||||
tcp_nodelay off; # on may be better for Comet/long-poll stuff
|
tcp_nodelay off; # on may be better for Comet/long-poll stuff
|
||||||
|
|
||||||
# Enable Gzip
|
# Enable Gzip:
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_http_version 1.0;
|
gzip_http_version 1.0;
|
||||||
gzip_comp_level 2;
|
gzip_comp_level 5;
|
||||||
gzip_min_length 1100;
|
gzip_min_length 512;
|
||||||
gzip_buffers 4 8k;
|
gzip_buffers 4 8k;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_types
|
gzip_types
|
||||||
# text/html is always compressed by HttpGzipModule
|
# text/html is always compressed by HttpGzipModule
|
||||||
|
@ -83,20 +73,23 @@ http {
|
||||||
application/vnd.ms-fontobject
|
application/vnd.ms-fontobject
|
||||||
image/svg+xml;
|
image/svg+xml;
|
||||||
|
|
||||||
gzip_static on;
|
# This should be turned on if you are going to have pre-compressed copies (.gz) of
|
||||||
|
# static files available. If not it should be left off as it will cause extra I/O
|
||||||
|
# for the check. It would be better to enable this in a location {} block for
|
||||||
|
# a specific directory:
|
||||||
|
# gzip_static on;
|
||||||
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
gzip_disable "MSIE [1-6]\.";
|
gzip_disable "MSIE [1-6]\.";
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
# listen 80 default deferred; # for Linux
|
# listen 80 default_server deferred; # for Linux
|
||||||
# listen 80 default accept_filter=httpready; # for FreeBSD
|
# listen 80 default_server accept_filter=httpready; # for FreeBSD
|
||||||
listen 80 default;
|
listen 80 default_server;
|
||||||
|
|
||||||
# e.g. "localhost" to accept all connections, or "www.example.com"
|
# e.g. "localhost" to accept all connections, or "www.example.com"
|
||||||
# to handle the requests for "example.com" (and www.example.com)
|
# to handle the requests for "example.com" (and www.example.com)
|
||||||
server_name _;
|
# server_name www.example.com;
|
||||||
|
|
||||||
# Path for static files
|
# Path for static files
|
||||||
root /sites/example.com/public;
|
root /sites/example.com/public;
|
||||||
|
@ -116,14 +109,12 @@ http {
|
||||||
# Static assets
|
# Static assets
|
||||||
location ~* ^.+\.(manifest|appcache)$ {
|
location ~* ^.+\.(manifest|appcache)$ {
|
||||||
expires -1;
|
expires -1;
|
||||||
root /sites/example.com/public;
|
|
||||||
access_log logs/static.log;
|
access_log logs/static.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set expires max on static file types
|
# Set expires max on static file types (make sure you are using cache busting filenames or query params):
|
||||||
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
|
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
|
||||||
expires max;
|
expires max;
|
||||||
root /sites/example.com/public;
|
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue