Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I tried to use this -

    location / {
      root    /path.to.app/;
      index   index.php index.html;
      rewrite                 ^/(.*)$ /check_register.php?key=$1 break;
      fastcgi_pass            127.0.0.1:9000;
      fastcgi_index           index.php;
      fastcgi_param           SCRIPT_FILENAME  /path.to.app/$fastcgi_script_name;
      include                 fastcgi_params;
    }

And its didn't work , This is my full config -

    user www-data www-data;
worker_processes  4;
events {
    worker_connections  3072;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    access_log  off;
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     off;
    keepalive_timeout  15;
    gzip  on;
    gzip_comp_level 3;
    gzip_proxied any;
    gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
        location / {
          root    /path.to.app/;
          index   index.php index.html;
          rewrite                 ^/(.*)$ /check_register.php?key=$1 break;
          fastcgi_pass            127.0.0.1:9000;
          fastcgi_index           index.php;
          fastcgi_param           SCRIPT_FILENAME  /path.to.app/$fastcgi_script_name;
          include                 fastcgi_params;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
include /usr/local/nginx/sites-enabled/*;
    }

How can i make it work?

share|improve this question
    
Can you be a little more specific about "it didn't work"? Did it do anything? –  nickgrim Dec 10 '12 at 11:25
    
I want to create a link like this one - domain.net/234234234 When i paste this config to my server its tell me that i have a problem with the syntax because of i use location / { twice –  Ido B Dec 10 '12 at 11:30
    
Yes. And it is probably right about it - what are you trying to achieve with the first "location / {" block, anything in it would be overridden by the second anyway? –  rackandboneman Dec 10 '12 at 12:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.