Just a quick guess. You are doing something like this in each of your sites fastcgi section? setting the script filename in each site like<br>fastcgi_pass <a href="http://127.0.0.1:9000">127.0.0.1:9000</a>;<br>fastcgi_index index.php;<br>
fastcgi_param SCRIPT_FILENAME /some/path/to/public_html/$fastcgi_script_name;<br><br>If you are doing this you actually reset all the http fastcgi_params that are set in any top level. Again if this is the case you need to either reinclude the fastcgi_params file in each of your site or change your SCRIPT_FILENAME to <br>
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; <br>in your fastcgi_params file and then in each of your server sections it will automatically have the script_filename set and you no longer have to do it for each server.<br>
<br><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 6:51 PM, Jim Ohlstein <span dir="ltr"><<a href="mailto:jim.ohlstein@gmail.com">jim.ohlstein@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That didn't work because the last two lines of nginx.conf are:<br>
<br>
include /usr/local/nginx/conf/fastcgi_params;<br>
include /usr/local/nginx/sites-enabled/*;<br>
<br>
So it was reset in fastcgi_params and still returned an empty string. What I did was hard code it in the site config. That worked. Presumably it won't output for other sites on the server either, not that it's really an issue.<br>
<br>
Thanks for your help Mike. I appreciate it greatly!<br>
<br>
Best,<br>
<br>
Jim<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a> [mailto:<a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a>] On Behalf Of mike<br>
Sent: Tuesday, October 28, 2008 7:24 PM<br>
To: <a href="mailto:nginx@sysoev.ru">nginx@sysoev.ru</a><br>
Subject: Re: Need help with global variable<br>
<br>
SERVER_ADDR is defined but empty. i am not sure here what to say...<br>
<br>
you -could- hard-code it in the nginx config probably...<br>
<br>
On Tue, Oct 28, 2008 at 4:11 PM, Jim Ohlstein <<a href="mailto:jim.ohlstein@gmail.com">jim.ohlstein@gmail.com</a>> wrote:<br>
> This is the result:<br>
><br>
> array(40) { ["HOSTNAME"]=> string(0) "" ["PATH"]=> string(28) "/usr/local/bin:/usr/bin:/bin" ["TMP"]=> string(4) "/tmp" ["TMPDIR"]=> string(4) "/tmp" ["TEMP"]=> string(4) "/tmp" ["OSTYPE"]=> string(0) "" ["MACHTYPE"]=> string(0) "" ["MALLOC_CHECK_"]=> string(1) "2" ["USER"]=> string(3) "jim" ["HOME"]=> string(32) "/path/to/my/domain/root" ["FCGI_ROLE"]=> string(9) "RESPONDER" ["QUERY_STRING"]=> string(0) "" ["REQUEST_METHOD"]=> string(3) "GET" ["CONTENT_TYPE"]=> string(0) "" ["CONTENT_LENGTH"]=> string(0) "" ["SCRIPT_FILENAME"]=> string(41) "/path/to/my/domain/root/test.php" ["SCRIPT_NAME"]=> string(9) "/test.php" ["REQUEST_URI"]=> string(9) "/test.php" ["DOCUMENT_URI"]=> string(9) "/test.php" ["DOCUMENT_ROOT"]=> string(32) "/path/to/my/domain/root" ["SERVER_PROTOCOL"]=> string(8) "HTTP/1.1" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["SERVER_SOFTWARE"]=> string(12) "nginx/0.7.19" ["REMOTE_ADDR"]=> string(13) "my.ip.add.ress" ["REMOTE_PORT"]=> string(4) "3719" ["SERVER_ADDR"]=> string(0) "" ["SERVER_PORT"]=> string(2) "80" ["SERVER_NAME"]=> string(17) "<a href="http://mydomain.com" target="_blank">mydomain.com</a>" ["REDIRECT_STATUS"]=> string(3) "200" ["HTTP_HOST"]=> string(17) "<a href="http://mydomain.com" target="_blank">mydomain.com</a>" ["HTTP_USER_AGENT"]=> string(90) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:<a href="http://1.9.0.3" target="_blank">1.9.0.3</a>) Gecko/2008092417 Firefox/3.0.3" ["HTTP_ACCEPT"]=> string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ["HTTP_ACCEPT_LANGUAGE"]=> string(14) "en-us,en;q=0.5" ["HTTP_ACCEPT_ENCODING"]=> string(12) "gzip,deflate" ["HTTP_ACCEPT_CHARSET"]=> string(30) "ISO-8859-1,utf-8;q=0.7,*;q=0.7" ["HTTP_KEEP_ALIVE"]=> string(3) "300" ["HTTP_CONNECTION"]=> string(10) "keep-alive" ["HTTP_COOKIE"]=> string(36) "PHPSESSID=qmuor210i861rct4te1qcmq1o6" ["PHP_SELF"]=> string(9) "/test.php" ["REQUEST_TIME"]=> int(1225235084) }<br>
><br>
> So that variable returns an empty string.<br>
><br>
> Hmmm...<br>
><br>
><br>
> Jim<br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a> [mailto:<a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a>] On Behalf Of mike<br>
> Sent: Tuesday, October 28, 2008 6:40 PM<br>
> To: <a href="mailto:nginx@sysoev.ru">nginx@sysoev.ru</a><br>
> Subject: Re: Need help with global variable<br>
><br>
> fastcgi_params can be set on the http {} level. i only have them defined once.<br>
><br>
> var_dump($_SERVER) on the php script. see what it says.<br>
><br>
> On Tue, Oct 28, 2008 at 3:31 PM, Jim Ohlstein <<a href="mailto:jim.ohlstein@gmail.com">jim.ohlstein@gmail.com</a>> wrote:<br>
>> I have that in there. Maybe I should add it to the site config file?<br>
>><br>
>> Jim<br>
>><br>
>><br>
>> -----Original Message-----<br>
>> From: <a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a> [mailto:<a href="mailto:owner-nginx@sysoev.ru">owner-nginx@sysoev.ru</a>] On Behalf Of mike<br>
>> Sent: Tuesday, October 28, 2008 6:19 PM<br>
>> To: <a href="mailto:nginx@sysoev.ru">nginx@sysoev.ru</a><br>
>> Subject: Re: Need help with global variable<br>
>><br>
>> you'd need to set that in a fastcgi_param<br>
>><br>
>> fastcgi_param SERVER_ADDR $server_addr;<br>
>><br>
>> is what i have. i haven't confirmed or used it though.<br>
>><br>
>> On Tue, Oct 28, 2008 at 3:13 PM, Jim Ohlstein <<a href="mailto:jim.ohlstein@gmail.com">jim.ohlstein@gmail.com</a>> wrote:<br>
>>> I am hosting a site that requires the following (according to the developer)<br>
>>> for a script license verification"<br>
>>><br>
>>><br>
>>><br>
>>> "global variable available from the server."<br>
>>><br>
>>><br>
>>><br>
>>> _SERVER['SERVER_ADDR']<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> The best that I can understand is that they need the server's IP address to<br>
>>> be returned.<br>
>>><br>
>>><br>
>>><br>
>>> "SERVER_ADDR" does not seem to be recognized by Nginx. Where do I go with<br>
>>> this?<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> Jim<br>
>><br>
>><br>
>><br>
><br>
><br>
><br>
<br>
<br>
</blockquote></div><br>