Skip to content

Instantly share code, notes, and snippets.

@daqing
Created February 22, 2009 11:16
Show Gist options
  • Save daqing/68436 to your computer and use it in GitHub Desktop.
Save daqing/68436 to your computer and use it in GitHub Desktop.
nginx config to run Aeolus
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
index index.php
access_log /var/log/nginx/access.log;
sendfile on;
tcp_nopush on;
client_header_timeout 30;
client_body_timeout 30;
client_max_body_size 65m;
#keepalive_timeout 0;
keepalive_timeout 5;
tcp_nodelay on;
server_names_hash_max_size 2048;
server_names_hash_bucket_size 128;
fastcgi_index index.php;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 300;
fastcgi_read_timeout 600;
gzip on;
server {
listen 80;
server_name trackgeek.cn;
root /var/www/trackgeek.cn;
access_log /var/log/nginx/trackgeek.log;
location = /nginx_status {
stub_status on;
}
location / {
index index.php index.html index.htm;
# serve static files that exists
if (-f $request_filename) {
expires 30d;
break;
}
# send all non-existing file or directory requests to index.php
# NOTE: Make sure the rewrite rules are inside the location block
if (!-e $request_filename) {
rewrite ^ /aeolus/index.php last;
}
}
location ~ \.php$ {
fastcgi_pass www.trackgeek.cn:1986;
fastcgi_index index.php;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # SAME PATH AS ABOVE
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
}
}
#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