Hey Igor,<br><br>Works great, only know it returns a 404 error with every request :( is there a way I can remove the header send by nginx?<br><br><div><span class="gmail_quote">On 12/13/07, <b class="gmail_sendername">Igor Sysoev
</b> <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thu, Dec 13, 2007 at 09:06:05AM +0100, Abdul-Rahman Advany wrote:
<br><br>> Hi guys,<br>><br>> I am running php with nginx, with fastcgi. But instead of heaving my urls<br>> like <a href="http://www.myblog.com/index.php/bla/bla">www.myblog.com/index.php/bla/bla</a> I would like
<br>> <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a><<a href="http://www.myblog.com/bla/bla.">http://www.myblog.com/bla/bla.</a>><br>><br>> With the setup at the end of the mail, it redirect if a file can't be found
<br>> to index.php, but I get the content of index.php back. (So if I go to<br>> <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a>).<br>><br>> But I also have other requests that should not be rewritten (directories and
<br>> files in the root directory). Is this possible? to redirect only if<br>> <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a> doesn't exist to a normal request to the root<br>> directory and send that to the fastcgi process?
<br><br>How does wordpress find what URI you request ?<br>I know that wordpress may use REQUEST_URI (it should already set<br>in /etc/nginx/fastcgi.conf):<br><br>fastcgi_param REQUEST_URI $request_uri;<br><br>The second way (I do not know whether Wordpress use it) is PATH_INFO:
<br><br> location / {<br> root /var/www/blog;<br> error_page 404 /index.php;<br> }<br><br> location ~ \.php$ {<br> include /etc/nginx/fastcgi.conf;<br> fastcgi_pass
<a href="http://127.0.0.1:8888">127.0.0.1:8888</a>;<br> fastcgi_param PATH_INFO $request_uri;<br> fastcgi_param SCRIPT_FILENAME /var/www/blog/$fastcgi_script_name;<br> }<br><br> location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ {
<br> root /var/www/blog;<br> }<br><br><br>> I really love nginx, and thanks to this mailinglist I didn't need much help.<br>> But most rewrite rules are written wordpress MU (multiuser) and not<br>
> wordpress redux. I just need to to rewrite all request that do not exists to<br>> index.php and pass this to fastcgi.<br>><br>> I did get this working one time.. but I can't figure out how I did it :S<br>
><br>> server {<br>> listen 80; # Replace this IP and port with the right<br>> ones for your requirements<br>> server_name <a href="http://www.myblog.com">www.myblog.com</a><br>><br>
> #charset koi8-r;<br>><br>> #access_log logs/host.access.log<br>><br>> location ~*<br>> ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$
<br>> {<br>> root /var/www/blog;<br>> }<br>><br>> error_page 404 /index.php;<br>><br>> location ~ \.php$ {<br>> include /etc/nginx/fastcgi.conf;<br>
> fastcgi_pass<br>> <a href="http://127.0.0.1:8888">127.0.0.1:8888</a>;<br>> fastcgi_index index.php;<br>> fastcgi_param SCRIPT_FILENAME /var/www/blog/$fastcgi_script_name;<br>
> }<br>><br>> # deny access to .htaccess files, if Apache's document root<br>> # concurs with nginx's one<br>> #<br>> #location ~ /\.ht {<br>> # deny all;
<br>> #}<br>><br>> }<br>><br>><br>><br>> --<br>> Abdul-Rahman Advany<br>><br>> IM: <a href="mailto:abdulrahman@advany.com">abdulrahman@advany.com</a><br><br>--<br>Igor Sysoev<br>
<a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Abdul-Rahman Advany<br><br>IM: <a href="mailto:abdulrahman@advany.com">abdulrahman@advany.com</a>