Skip to content

Instantly share code, notes, and snippets.

@CarterA
Created September 19, 2010 07:17
Show Gist options
  • Select an option

  • Save CarterA/586517 to your computer and use it in GitHub Desktop.

Select an option

Save CarterA/586517 to your computer and use it in GitHub Desktop.
#### nginx -V
nginx version: nginx/0.8.50
built by gcc 4.3.2 (Debian 4.3.2-1.1)
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx --with-http_flv_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/
#### nginx.conf
user www www;
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
}
http {
include mime.types;
include /etc/nginx/proxy.conf;
include /etc/nginx/fastcgi.conf;
default_type application/octet-stream;
index index.html index.htm index.php;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/sites-enabled/*.conf;
}
#### /etc/nginx/sites-enabled/zcr.me.conf
server {
server_name www.zcr.me;
rewrite ^ $scheme://zcr.me$request_uri permanent;
}
server {
set $user carterallen;
set $site zcr.me;
server_name $site www.$site;
root /home/$user/sites/$site/public;
access_log /home/$user/sites/$site/logs/access.log main;
location / {
rewrite ^/([0-9a-zA-Z]+)/?$ /index.php?id=$1 last;
}
error_page 404 /errors/404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
#### /var/log/nginx/error.log
2010/09/19 07:15:58 [error] 13585#0: *36 "/var/www/zcr.me/index.html" is not found (2: No such file or directory), client: 174.51.39.29, server: zcr.me, request: "GET / HTTP/1.1", host: "zcr.me"
2010/09/19 07:15:58 [error] 13585#0: *36 open() "/var/www/zcr.me/favicon.ico" failed (2: No such file or directory), client: 174.51.39.29, server: zcr.me, request: "GET /favicon.ico HTTP/1.1", host: "zcr.me"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment