Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/08/2012, 06:53
SeaPirates
 
Fecha de Ingreso: enero-2009
Ubicación: España
Mensajes: 786
Antigüedad: 15 años, 3 meses
Puntos: 9
URL rewrite en nginx

Hola, acabo de instalar nginx porque IIS me daba problemas, pero he intentado usar el rewrite en el config y lo colqué asi.


Cita:
server {
listen 80;
server_name localhost;
root www;

#charset koi8-r;
#access_log logs/host.access.log main;
rewrite ^register$ /register.php last;

location / {
index index.html index.htm index.php;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .*\.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}

# add expire headers
location ~* ^.+.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml| txt|js|css)$ {
expires 30d;
}

# only allow these request methods
if ($request_method !~ ^(GET|HEAD|POST)$ ){ return 405; }

# deny access to .htaccess files
location ~ /\.ht { deny all; }
}
Pero no me funciona..

Última edición por SeaPirates; 14/08/2012 a las 08:38