# Look for existence of PHP index file.<br> # Don't break here...just rewrite it.<br> if (-f $request_filename/index.php) {<br> rewrite (.*) $1/index.php;<br> }<br><br><div class="gmail_quote">On Thu, Feb 21, 2008 at 11:19 PM, dika <<a href="mailto:andika@agrakom.com">andika@agrakom.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<small>Hai Teams,<br>
<br>
I've installed NginX to host my Wordpress MU.<br>
Everything running well, but one thing didn't works properly.<br>
<br>
When I use this : <a href="http://202.158.66.216/wp-admin/" target="_blank">http://202.158.66.216/wp-admin/</a><br>
I got <b>Error 404 - Not Found.<br>
<br>
</b>But if I use : <a href="http://202.158.66.216/wp-admin/index.php" target="_blank">http://202.158.66.216/wp-admin/index.php</a><br>
everything's running well.<br>
<br>
What should I do to make this run without adding /index.php ?<br>
<br>
here are my nginx.conf :<br>
<br>
-------<br>
server {<br>
listen 80;<br>
server_name <a href="http://202.158.66.216" target="_blank">202.158.66.216</a> ;<br>
error_log /var/log/nginx/error.lo;<br>
location ~*
^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$<br>
{<br>
root /data/blog/wp;<br>
expires 30d;<br>
break;<br>
}<br>
<br>
location / {<br>
root /data/blog/wp;<br>
index index.html index.htm index.php;<br>
rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;<br>
<br>
if (!-e $request_filename) {<br>
rewrite ^.+?(/wp-.*) $1 last;<br>
rewrite ^.+?(/.*\.php)$ $1 last;<br>
}<br>
<br>
if ($query_string !~ ".*s=.*") {<br>
rewrite ^(.*) /wp-content/cache/supercache/$http_host/$1index.html;<br>
}<br>
<br>
if ($http_cookie !~ "^.*comment_author_.*$" ) {<br>
rewrite ^(.*) /wp-content/cache/supercache/$http_host/$1index.html;<br>
}<br>
<br>
if ($http_cookie !~ "^.*wordpressuser.*$" ) {<br>
rewrite ^(.*) /wp-content/cache/supercache/$http_host/$1index.html;<br>
}<br>
<br>
if ($http_cookie !~ "^.*wp-postpass_.*$" ) {<br>
rewrite ^(.*) /wp-content/cache/supercache/$http_host/$1index.html<br>
break;<br>
}<br>
<br>
error_page 404 = @tricky;<br>
}<br>
error_page 500 502 503 504 /50x.html;<br>
location = /50x.html {<br>
root html;<br>
}<br>
<br>
location @tricky {<br>
rewrite ^ /index.php last;<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
fastcgi_index index.php;<br>
fastcgi_param SCRIPT_FILENAME /data/blog/wp$fastcgi_script_name;<br>
include /opt/nginx/conf/fastcgi_params;<br>
}<br>
<br>
location ~ \.php$ {<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
fastcgi_index index.php;<br>
fastcgi_param SCRIPT_FILENAME /data/blog/wp$fastcgi_script_name;<br>
include /opt/nginx/conf/fastcgi_params;<br>
}<br>
}<br>
<br>
--<br>
<br>
Thanks for advice.<br>
<br>
<b>Andika</b><br>
Indonesian<br>
</small>
</div>
</blockquote></div><br>