fak3r

dim high beams for oncoming traffic


HOWTO: Configure nginx for Debian / Ubuntu

nginx_small HOWTO: Configure nginx for Debian / UbuntuUPDATE: I’m reworking my config blending in the security ideas found on camomel.org they’re really thought things through on this, this should make for a very secure environment.

I’m always trying new software, and with the I’ve moved from 1.3 to 2.0 to 2.2, and then later I moved everything over to , which I’ve liked, save for some memory issues that popped up.  Now, enter a web server named nginx (engine x), written by a Russian hacker. It’s already proved it’s meddle by running some of the largest Russian sites for years now.  It has the speed of Lighttpd, but with none of that memory weirdness, plus it uses a fraction of the CPU, so scaling should be smooth for highly visited sites.  It also does cool things like load balancing, reverse proxy, IMAP and POP proxy, etc, so I can see it being used in a variety of ways on a network.  It took me some time to understand how to configure it, which was a case of me just making it harder than it really is, so I wanted to post it here.  Look for updates as we go along, but this is currently backing a Production site I manage.

user					www-data www-data;
worker_processes  			5;
pid 					/var/run/.pid;
events {
worker_connections 1024;
}
http {
include				/etc//mime.types;
default_type			application/octet-stream;
log_format main 		'$remote_addr $host $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” “$http_user_agent” ‘
‘”$request_time” “$gzip_ratio”‘;
access_log			/var/log//access.log  main;
error_log			/var/log//error.log;
sendfile 			on;
tcp_nopush        		on;
tcp_nodelay      		off;
keepalive_timeout		65;
gzip				on;
gzip_http_version		1.1;
gzip_vary			on;
gzip_comp_level 		6;
gzip_buffers			16 8k;
#gzip_proxied			expired no-cache no-store private auth;
gzip_proxied 			any;
gzip_min_length			1000;
gzip_types			text/plain text/html text/css application/json application/x-javascript
text/xml application/xml application/xml+rss text/javascript;
server {
listen			80;
client_max_body_size	50M;
server_name 		server.domain.com;
root 			/var/www;
index  			index.html index.php;
access_log  		/var/log//access.log  main;
error_page   		500 502 503 504  /500.html;
location = /500.html {
root		/var/www;
}
location ~* ^.+.(jpg|jpeg|gif)$ {
root		/var/www;
expires         30d;
}
location ~ \.php$ {
include /etc//fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
}
}

Software support must evolve with Open Source

SupportAs a IT contractor I’m enjoying giving my opinion when asked, and sometimes even when I’m not asked; I have the confidence to be open and honest with everyone and want them to know that. Because of this I’ve been getting to do things I otherwise would not have since they would not have known I was interested or experienced in such things. One of the things I was hired for was to setup on to work with their web instances. It’s been fun, and while I’ve used for over 10 years, there’s always new things to learn. Recently they asked for my opinion on ’support’ options for . Keeping in mind, they already have support for the hardware and support for the distribution, they still think they need another support channel for . To me this a big waste of money and have somewhat made my case to them. While I understand their position that this support is a way to cover themselves if ‘breaks’, the fact that this software is has to change the way they have traditionally considered support.

(more…)


  • Recent Comment

    • Daniella Newmark: Greetings, I would like to help you solve your problem. We are a global content delivery network...
    • Jason Thurow: What type of files are you moving and to where? I work for a company that offers a software solution...
    • Justin Peron: Hey there. I can give you a run-down of what a CDN is and how they work. Also I can give you an idea of...
    • chris: great site tons of great articles very useful information <a href=”http://www.adve...
    • Baba: Bloxtr is nothing but eyeOS hosted on a website bloxtr.com – They have done a good deed, but should not...