Welcome! Log In Create A New Profile

Advanced

nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

January 29, 2011 04:13PM
hello, i have nginx setup, but i have a weird problem and i am unsure whether it is to do with the application or something i messed up on the nginx.conf file:

[code]
server {
listen 87.98.133.231:80;
server_name dev.editionsdelga.fr;

location / {
root /www/dev.editionsdelga.fr/1.3.6;
index index.html index.htm index.php;
#see http://www.prestashop.com/forums/viewthread/61175/installing_prestashop/nginxphpfmp_configuration
rewrite ^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg last;
rewrite ^/([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg last;
rewrite ^/([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg last;
rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5" last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4" last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1" last;
rewrite ^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 last;
rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 last;
rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 last;
rewrite ^/content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 last;
rewrite ^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 last;
rewrite ^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 last;
rewrite "^/lang-([a-z]{2})/(.*)$ /$2?isolang=$1" last;


}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

fastcgi_param SCRIPT_FILENAME /www/dev.editionsdelga.fr/1.3.6$fastcgi_script_name;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_client_abort on;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
} # end server for dev.editionsdelga.fr

[/code]

when you view the site, all links are missing the last '/' so instead of getting http://dev.editionsdelga.fr/manufacturer.php
you get http://dev.editionsdelga.frmanufacturer.php/

# nginx -v
nginx version: nginx/0.8.54

# php -v
PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 26 2011 19:38:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.1, Copyright (c) 2005-2010, by mOo

Any advice much appreciated.

Norman
Subject Author Posted

nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

khine January 29, 2011 04:13PM

Re: nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

Maxim Dounin January 29, 2011 08:34PM

Re: nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

khine January 30, 2011 04:05PM

Re: nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

khine February 11, 2011 08:09AM

Re: nginx, spawn-fcgi and php on freebsd - adding '/' incorrectly

Maxim Dounin January 30, 2011 06:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 254 on July 05, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready