-
-
Save cgrymala/de17d32ce81d5782d6b9 to your computer and use it in GitHub Desktop.
UMW Nginx Main Config
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-data; | |
worker_processes 4; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# multi_accept on; | |
} | |
http { | |
server_tokens off; | |
include /etc/nginx/mime.types; | |
access_log /var/log/nginx/access.log; | |
default_type application/octet-stream; | |
client_body_temp_path /var/lib/nginx/body 1 2; | |
client_max_body_size 100M; | |
gzip on; | |
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
gzip_buffers 32 8k; | |
gzip_types application/javascript text/javascript text/css text/xml application/atom+xml application/xml; | |
sendfile on; | |
keepalive_timeout 65; | |
tcp_nodelay on; | |
# set some parameters: two levels deep for the filesystem | |
# set the name of the cache to "staticfilecache", giving it a maximum cache time of 3 hours and 500meg in size. | |
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=staticfilecache:180m max_size=500m; | |
proxy_temp_path /var/lib/nginx/proxy; | |
proxy_connect_timeout 30; | |
proxy_read_timeout 120; | |
proxy_send_timeout 120; | |
#IMPORTANT - this sets the basic cache key that's used in the static file cache. | |
proxy_cache_key "$scheme://$host$request_uri"; | |
upstream wordpressapache { | |
#The upstream apache server. You can have many of these and weight them accordingly, | |
#allowing nginx to function as a caching load balancer (oh my. Awesomeness abounds.) | |
server 127.0.0.1:81 weight=1 fail_timeout=120s; | |
} | |
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