Equivalent of Apache's SetEnv Variable

Michael Shadle mike503 at gmail.com
Wed Aug 4 23:53:06 MSD 2010


I personally don't use location / unless absolutely needed.

On Aug 4, 2010, at 8:07 AM, Raina Gustafson <raina at thequeensmen.com> wrote:

> So far, so good. I'd tried this location previously, but hadn't tested
> with the variable dump, so didn't think it was working. I removed it
> from location /, and it is still working. location ~ \.php$ alone
> seems to be adequate, and each domain is respecting it's unique
> settings in the var dump.
> 
> On Tue, Aug 3, 2010 at 6:34 PM, Michael Shadle <mike503 at gmail.com> wrote:
>> yeah, var_dump($_SERVER) - should show you normal variables.
>> 
>> Do you see $_SERVER['HTTPS']?
>> 
>> I think the key location you're missing is putting it in here:
>> 
>> location ~ \.php$ { ## Execute PHP scripts
>>        expires                 off; ## Do not cache dynamic content
>>        fastcgi_param   HTTPS $fastcgi_https;
>>        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
>>        fastcgi_param   PATH_INFO $fastcgi_script_name;
>>        fastcgi_pass    127.0.0.1:9000;
>>        fastcgi_index   index.php;
>>        include                 fastcgi_params; ## See /etc/nginx/fastcgi_params
>> 
>> try adding these?
>> 
>>             fastcgi_param  MAGE_RUN_CODE  base;
>>             fastcgi_param  MAGE_RUN_TYPE  website;
>> 
>>    }
>> 
>> FYI, I was not aware of an $fastcgi_https variable. If there is one,
>> that is awesome and I need to add that to my fastcgi_params - it
>> should be default as most apps seem to rely on $_SERVER['HTTPS']
>> 
>> I am going to go look if it exists or not :)
>> 
>> On Tue, Aug 3, 2010 at 4:11 PM, Raina Gustafson <raina at thequeensmen.com> wrote:
>>> Ok. That's really helpful information. Right now, both of these output nothing:
>>> <?php echo $_SERVER['MAGE_RUN_CODE']; ?>
>>> <?php echo $_SERVER['MAGE_RUN_TYPE']; ?>
>> 
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list