Created
February 26, 2012 16:01
-
-
Save 2no/1917460 to your computer and use it in GitHub Desktop.
dotCloud に WordPress を wordpress ディレクトリにインストールした場合の nginx.conf サンプル
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
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location = /robots.txt { | |
| allow all; | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location ~ /\. { | |
| deny all; | |
| access_log off; | |
| log_not_found off; | |
| } | |
| rewrite /wordpress/wp-admin$ $scheme://$host$uri/ permanent; | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
| expires 24h; | |
| log_not_found off; | |
| } | |
| location / { | |
| try_files $uri $uri/ /index.php$uri; | |
| rewrite ^(/)$ /wordpress$1 last; | |
| } | |
| location ~ ".+\.php($|/.*)" { | |
| if ( -f /home/dotcloud/current/maintenance) { | |
| return 503; | |
| } | |
| fastcgi_pass unix:/var/dotcloud/php5-fpm.sock; | |
| include fastcgi_params; | |
| include /home/dotcloud/current/*fastcgi.conf; | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| fastcgi_param PATH_INFO $fastcgi_path_info; | |
| fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
| } | |
| if (!-e $request_filename) { | |
| rewrite ^(/wp-.+) /wordpress$1 last; | |
| rewrite ^(/wp-admin/.+\.php(/.*)?)$ /wordpress$1 last; | |
| rewrite ^(/.*\.php(/.*)?)$ /wordpress$1 last; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment