Skip to content

Instantly share code, notes, and snippets.

@vortec
Created September 7, 2012 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vortec/3666462 to your computer and use it in GitHub Desktop.
Save vortec/3666462 to your computer and use it in GitHub Desktop.
drwx------ 2 www-data root 4096 Sep 7 15:55 nginx-cache
drwx------ 2 www-data root 4096 Sep 7 15:55 nginx-temp
# /etc/nginx/sites-enabled/myconf
upstream zope {
server 127.0.0.1:8080;
#server 127.0.0.1:8081;
}
log_format cache '***$time_local '
'$upstream_cache_status '
'Cache-Control: $upstream_http_cache_control '
'Expires: $upstream_http_expires '
'"$request" ($status) '
'"$http_user_agent" ';
access_log /var/log/nginx/cache.log cache;
proxy_cache_path /var/tmp/nginx-cache levels=1:2 keys_zone=cache:10m;
proxy_temp_path /var/tmp/nginx-temp;
server {
listen 8000;
server_name 192.168.2.53;
location / {
proxy_pass http://zope;
proxy_cache cache;
proxy_cache_key $request_uri;
proxy_cache_valid 200 1h;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_buffering off;
proxy_read_timeout 100000000000;
proxy_next_upstream http_503;
}
}
# /etc/nginx/nginx.conf
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment