Created
October 21, 2012 23:32
-
-
Save PlayGod/3928932 to your computer and use it in GitHub Desktop.
nginx.conf for wordpress
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 nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
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/conf.d/*.conf; | |
server_names_hash_bucket_size 128; | |
server { | |
server_name bladablada.net www.bladablada.net; | |
listen 123.456.789.10; | |
root /home/bladablada/public_html; | |
index index.php; | |
access_log /var/log/nginx/bladablada.net_access_log; | |
error_log /var/log/nginx/bladablada.net_error_log; | |
error_page 404 = @wordpress; | |
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | |
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_FILENAME /home/bladablada/public_html$fastcgi_script_name; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; | |
fastcgi_param DOCUMENT_ROOT /home/bladablada/public_html; | |
fastcgi_param SERVER_PROTOCOL $server_protocol; | |
fastcgi_param REMOTE_ADDR $remote_addr; | |
fastcgi_param REMOTE_PORT $remote_port; | |
fastcgi_param SERVER_ADDR $server_addr; | |
fastcgi_param SERVER_PORT $server_port; | |
fastcgi_param SERVER_NAME $server_name; | |
location ^~ /files/ { | |
rewrite /files/(.+) /wordpress/wp-includes/ms-files.php?file=$1 last; | |
} | |
location @wordpress { | |
fastcgi_pass localhost:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root/index.php; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_param SCRIPT_NAME /index.php; | |
} | |
location ~ \.php$ { | |
try_files $uri @wordpress; | |
fastcgi_index index.php; | |
fastcgi_pass localhost:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
} | |
location ^~ /blogs.dir/ { | |
internal; | |
root /home/bladablada/public_html/wordpress/wp-content; | |
} | |
include /home/bladablada/public_html/nginx.conf; | |
fastcgi_read_timeout 60; | |
ssi off; | |
ssi_silent_errors off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment