Convert lighttpd rewrite rule to nginx

justin nginx-forum at nginx.us
Thu Jul 26 00:47:57 UTC 2012


Igor,

Thanks for the reply. Still not working, getting 404 error.

Here is the config snippet I am using:

server {
  listen 80;

  server_name app.mydomain.com;

  root /srv/www/domains/app.mydomain.com;
  
  index index.php;

  access_log /var/log/nginx/domains/app.mydomain.com/access.log;
  error_log /var/log/nginx/domains/app.mydomain.com/error.log;

  include /etc/nginx/excludes.conf;

  location ~ ^[^.]+$ {
    try_files $uri =404;
    fastcgi_param SCRIPT_FILENAME $document_root/controller.php;
    fastcgi_param PATH_INFO $uri;
    fastcgi_intercept_errors on;
    fastcgi_pass 127.0.0.1:9000;
    include /etc/nginx/fastcgi_params;
  }

  #Needed for standard php files which end with the .php extension
  include /etc/nginx/php.conf;

  include /etc/nginx/expires.conf;
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,228909,228976#msg-228976



More information about the nginx mailing list