On Tue, 10 Jun 2014 22:43:05 +0100 Francis Daly <fran...@daoine.org> wrote:
> The rest of the config? :) Well, I've posted it in my previous request for help. Beeing longish I tried to spare some bandwith... :) > > == > server { > rewrite ^/(.*)_k(.*).htm$ /pagina.php?k=$2 ; > rewrite ^/privacy.php$ /pagina.php?k=privacy ; Wow! I had it under "location /" Moving it to "server" level and adding a "break" seems to make it work! > location = /pagina.php { > return 200 "I got $uri$is_args$args from $request_uri\n"; > } Many thanks for this elegant way of debugging this kind of configuration problems. > What do you have that is different? Another problem :( If I try the same thing in a subdirectory, it doesn't work. In the error log I get: 2014/06/11 17:51:46 [error] 602#0: *264 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 212.121.88.183, server: new.assirm.it, request: "GET /en/privacy.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9004", host: "new.assirm.it", referrer: "http://new.assirm.it/en/history_khistory.htm" It seems that the "location =" that I've put to intercept the rewrite doesn't match. My configuration, now looks like this: server { listen 212.45.144.216:80 default_server; server_name new.assirm.it test.assirm.it; access_log /dati/log/http/assirm/access.log; error_log /dati/log/http/assirm/error_new.log; rewrite_log on; rewrite ^/ultime-news.php$ /archivio-news.php?last=1 ; rewrite ^/(.*)_news(.*).htm$ /news.php?id=$2 ; rewrite ^/(.*)_ev(.*).htm$ /evento.php?id=$2 ; rewrite ^/(.*)_att(.*).htm$ /attivita.php?id=$2 ; rewrite ^/(.*)_k(.*).htm$ /pagina.php?k=$2 ; rewrite ^/(.*)_sk(.*).htm$ /stampa-contenuto.php?k=$2 ; rewrite ^/(.*)_sn(.*).htm$ /stampa-news.php?id=$2 ; rewrite ^/(.*)_a(.*).htm$ /associato.php?id=$2&$args ; rewrite ^/(.*)_p(.*).htm$ /mypost.php?id=$2&$args ; rewrite ^/ricerca-(.*).htm$ /risultati.php?s=$1&goo=1 ; rewrite ^/privacy.php$ /pagina.php?k=privacy break; location ~ \.php$ { root /dati/httpd/web_assirm/sito_nginx; fastcgi_pass 127.0.0.1:9004; fastcgi_index index.php; include /etc/nginx/fastcgi.conf; } location / { root /dati/httpd/web_assirm/sito_nginx; index index.html index.htm index.php home.html welcome.html; } location ^~ /en/ { root /dati/httpd/web_assirm/sito_nginx; index index.html index.htm index.php home.html; rewrite ^/en/ultime-news.php$ /en/archivio-news.php?last=1 ; rewrite ^/en/(.*)_news(.*).htm$ /en/news.php?id=$2 ; rewrite ^/en/(.*)_ev(.*).htm$ /en/evento.php?id=$2 ; rewrite ^/en/(.*)_att(.*).htm$ /en/attivita.php?id=$2 ; rewrite ^/en/(.*)_k(.*).htm$ /en/pagina.php?k=$2 ; rewrite ^/en/(.*)_sk(.*).htm$ /en/stampa-contenuto.php?k=$2 ; rewrite ^/en/(.*)_sn(.*).htm$ /en/stampa-news.php?id=$2 ; rewrite ^/en/(.*)_a(.*).htm$ /en/associato.php?id=$2&$args ; rewrite ^/en/(.*)_p(.*).htm$ /en/mypost.php?id=$2&$args ; rewrite ^/en/(.*)_wit(.*).htm$ /en/wit.php?c=$2&$args ; rewrite ^/en/ricerca-(.*).htm$ /en/risultati.php?s=$1&goo=1 ; rewrite ^/en/privacy.php /en/pagina.php?k=privacy ; location = /en/pagina.php { return 200 "I got $uri$is_args$args from $request_uri\n"; } location ~ \.php$ { index index.html index.htm index.php home.html; fastcgi_pass 127.0.0.1:9004; fastcgi_index index.php; include /etc/nginx/fastcgi.conf; } } } -- /"\ /Via A. Salaino, 7 - 20144 Milano (Italy) \ / ASCII RIBBON CAMPAIGN / PHONE : +39 2 485781 FAX: +39 2 48578250 X AGAINST HTML MAIL / E-MAIL: posthams...@sublink.sublink.org / \ AND POSTINGS / WWW: http://www.lesassaie.IT/ _______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx