Score:0

change fastcgi directory in nginx configuration

cn flag

i am not sure how to write the proper title
i have 5 ajax requests that gonna execute postgresql query in php

here is the directory

/var/www/webgis.com:
1. webgis.html
2. php(directory)
    -query1.php
    -query2.php
    -query3.php
    -query4.php
    -query5.php
3.etc

the all previous ajax url is url: "php/query(N).php", i want to change it intourl: "query(N).php" without change my server directory
i use this script but doesn't work

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
        set $php_root /var/www/webgis.com/php;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $php_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }

can somebody help me/ tell me what should i write?

Richard Smith avatar
jp flag
Try: `location = /kuery1.php { rewrite ^ /php/quer1.php last; }`
astaga avatar
cn flag
sorry, my mistake. i already edit the question, i mean.. i want to remove "/php" directory in all url ajax request.. but without moving php script into parents directory..
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.