Created
November 19, 2012 04:03
-
-
Save singleseeker/4108880 to your computer and use it in GitHub Desktop.
ngnix::conf-domain
This file contains hidden or 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
log_format www.{{yoursiteurl}}.com '$remote_addr - $remote_user [$time_local] $request ' | |
'$status $body_bytes_sent $http_referer ' | |
'$http_user_agent $http_x_forwarded_for'; | |
server | |
{ | |
listen 80; | |
server_name www.{{yoursiteurl}}.com {{yoursiteurl}}.com; | |
index index.html index.htm index.php default.html default.htm default.php; | |
root /home/wwwroot/www.{{yoursiteurl}}.com; | |
location /blog | |
{ | |
if (-f $request_filename/index.php) | |
{ | |
rewrite (.*) $1/index.php; | |
} | |
if (!-f $request_filename) | |
{ | |
rewrite ^/blog/(.*)$ /blog/index.php; | |
} | |
} | |
location ~ .*\.(php|php5)?$ | |
{ | |
try_files $uri =404; | |
fastcgi_pass unix:/tmp/php-cgi.sock; | |
fastcgi_index index.php; | |
include fcgi.conf; | |
} | |
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ | |
{ | |
expires 30d; | |
} | |
location ~ .*\.(js|css)?$ | |
{ | |
expires 12h; | |
} | |
if (-d $request_filename){ rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent; } | |
access_log /home/wwwlogs/www.{{yoursiteurl}}.com.log www.{{yoursiteurl}}.com; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment