Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have strange situation...my permalinks not work after setup nginx to work with apache.

permalinks work if they not finish with ".html", but work if finish with "/"

ie.: this work: justflick.com/new-the-dark-knight-rises-set-photo-2012-01-25.html/tom-hardy-as-bane-in-the-dark-knight-rises

but this don't: justflick.com/new-the-dark-knight-rises-set-photo-2012-01-25.html

here is my confog for nginx for this site.

 server {

  access_log off;

  error_log  /etc/nginx/logs/vhost-error_log warn;
  listen    80;
  server_name  justflick.com www.justflick.com;

  # uncomment location below to make nginx serve static files instead of Apache
  # NOTE this will cause issues with bandwidth accounting as files wont be logged
  location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
   root   /home/justflic/public_html;
  }

  location / {
   client_max_body_size    10m;
   client_body_buffer_size 128k;

   proxy_send_timeout   90;
   proxy_read_timeout   90;

   proxy_buffer_size    4k;
   # you can increase proxy_buffers here to suppress "an upstream response
   #  is buffered to a temporary file" warning
   proxy_buffers     16 32k;
   proxy_busy_buffers_size 64k;
   proxy_temp_file_write_size 64k;

   proxy_connect_timeout 30s;


   proxy_pass   http://76.76.22.237:88/;

   proxy_set_header   Host   $host;
   proxy_set_header   X-Real-IP  $remote_addr;
   proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
 }
share|improve this question

1 Answer 1

up vote 1 down vote accepted

It isn't working because Nginx tries to serve the permalink as a static file. At the moment the current configuration doesn't allow HTML files to be passed to Apache. Please remove the "html" part from the following block so that the permalinks are passed to Apache...

location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ { root /home/justflic/public_html; }

Once you remove the html, it should look like the following...

location ~* .(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|js|css)$ { root /home/justflic/public_html; }

Hope this helps.

share|improve this answer
    
this is solution! tnx –  user1152342 Feb 16 '12 at 13:55
    
glad to help. :) –  Pothi Feb 17 '12 at 12:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.