Rewrite

Silvio Siefke lists at silvio-siefke.de
Thu Jun 23 03:48:17 MSD 2011


On Thu, 23 Jun 2011 00:32:15 +0100 António P. P. Almeida wrote:
> 
> Try this:
> 
> location /article-(\d+)\.html$ {
>    try_files $uri $uri/ /blog.html?id=$1; # Is it blog.html or
> blogdetail.hmtl? }

Thanks for answer. Its blogdetail. Is same, it come 404. 


<config>
server {
listen;
server_name  ;
access_log  /usr/local/www/vserver/silviosiefke.de/log/access.log  main;
error_log /usr/local/www/vserver/silviosiefke.de/log/error.log;

location / {
root   /usr/local/www/vserver/silviosiefke.de/data;
index  index.php index.html index.htm;
}

error_page   500 502 503 504  /50x.html;

location = /50x.html {
         root   /usr/local/www/nginx-dist;
}

location /article-(\d+)\.html$ {
try_files $uri $uri/ /blogdetail.html?id=$1;

# pass the PHP scripts to FastCGI 
location ~ \.(php|htm|html)$ {
fastcgi_pass   127.0.0.1:9002;
fastcgi_index  index.php;
fastcgi_param SCRIPT_FILENAME  /usr/local/www/vserver/data
$fastcgi_script_name; include /usr/local/etc/nginx/fastcgi_params; 
}
 
location ~ /\.ht {
deny  all;
}
}
</config>


<log>
- - [23/Jun/2011:01:43:19 +0200] "GET /article-1.html HTTP/1.1"
404 31 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like
Gecko) Chrome/12.0.742.100 Safari/534.30" "-"
</log>

Regards
Silvio



More information about the nginx mailing list