title: Ajax not working on Nginx / Wordpress
body: <p>ahoy,</p>
  
  <p>i'm running wordpress 3x on nginx and all my ajax calls are broken. the exactly same wordpress runs fine on Apache.</p>
  
  <p>i've fixed somehow an ajax call to work with nginx by removing 'index.php' from all jquery.post() calls, but i couldn't fix the other calls in the same way.</p>
  
  <p>basically the changes were:
  for nginx the line:</p>
  
  <pre><code>jQuery.post( 'index.php?ajax=true', form_values, function(returned_data) {
  </code></pre>
  
  <p>was replaced with:</p>
  
  <pre><code>jQuery.post( '?ajax=true', form_values, function(returned_data) {
  </code></pre>
  
  <p>i suspect the problem lies in the nginx config file with rewrite rules. There you are with my configuration</p>
  
  <pre><code>if (!-e $request_filename) {
  rewrite ^.+/?(/wp-.*) $1 last;
  rewrite ^.+/?(/.*\.php)$ $1 last;
  rewrite ^(.+)$ /index.php?q=$1 last;
  }
  
  
  location ~ \.php$ {
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME /xxx/public$fastcgi_script_name;
  include fastcgi_params;
  }
  }
  </code></pre>