Problem : nginx with magento

hi i am using nginx with magento which use fastCGI .
whenever i type in url http://example.com/index.php then index.php start
downloading .
can anyone help me ?

On Mon, Jun 8, 2015 at 7:04 PM, Prameswar Lal
[email protected]
wrote:

hi i am using nginx with magento which use fastCGI .
whenever i type in url http://example.com/index.php then index.php start
downloading .
can anyone help me ?

I think you have misspelled a directive
In example.conf

– fastcqi_index index.php;
++ fastcgi_index index.php;

Good Luck !

still same problem .
i have checked with different os like centos , ubuntu and different
version
of php , nginx

On Mon, Jun 08, 2015 at 07:04:22PM +0530, Prameswar Lal wrote:

Hi there,

hi i am using nginx with magento which use fastCGI .
whenever i type in url http://example.com/index.php then index.php start
downloading .
can anyone help me ?

What does the file /var/log/nginx/nginx-access.log say about this
request?

As in: are you certain that this request is handled by this server{}
block?

And if so: what is the content of the file index.php? Does it include
any php tags at all? Does it include short tags that your fastcgi server
does not honour?

What is the start of the output of “curl -i
http://example.com/index.php”? Specifically: what are all of the http
headers returned?

f

Francis D. [email protected]

Hi,

On 09/06/15 01:34, Prameswar Lal wrote:

hi i am using nginx with magento which use fastCGI .
whenever i type in url http://example.com/index.php then index.php
start downloading .
can anyone help me ?

location ~ .php$ {

 fastcqi_index index.php;
 fastcgi_pass   127.0.0.1:9000;
 fastcgi_pass unix:/var/run/php5-fpm.sock;
 include fastcgi_params;
 fastcgi_intercept_errors on;
 # By all means use a different server for the fcgi processes if you 

need to

fastcgi_split_path_info ^(.+.php)(.*)$;

}

You have 2 fastcgi_pass lines, one to 127.0.0.1:9000 and one to
unix:/var/run/php5-fpm.sock

Only one of these should be there, the correct one will be defined in
your php-fpm configuration, which isn’t shown.

I use a backend predefined in nginx.conf to identify the php-fpm pool to
use. The 2 relevant location blocks in a base install of mine…

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ .php$ {
try_files $uri =404;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass backend;

}

which will work with just about every PHP based CMS out there… well
enough to get you started…

Steve

Hi ,
i am sending current access log after changing according to steve block
.

Not problem with index.php . it has problem with all page of .php in
magento tool .
i am using magento tool so this is file of magento . not written by me .
magento use fastcgi programing in it .
i have tested this magento with apache it works fine.
i have tested on different system centos , ubuntu fresh machine.

output of curl is .
[email protected]:/var/log/nginx# curl -I http://example.com/index.php
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 09 Jun 2015 01:59:02 GMT
Content-Type: application/octet-stream
Content-Length: 2642
Last-Modified: Wed, 14 May 2014 16:03:36 GMT
Connection: keep-alive
ETag: “537393d8-a52”
Accept-Ranges: bytes

On Tue, Jun 9, 2015 at 7:16 AM, Prameswar Lal
[email protected]

Hi

On 09/06/15 13:46, Prameswar Lal wrote:

hi i am using nginx with magento which use fastCGI .
     fastcgi_intercept_errors on;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;

Steve

--
Steve H. BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin:http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

If it’s just downloading the code, then it’s not being passed to your
php-fastcgi processes. I assume you’re not now getting a ‘bad gateway’
error, so it’s never being asked to do so.

Are you sure this is the config file you’re actually processing, and
there’s no default one taking precedence ( note the format of the listen
makes a difference )???

Hi steve ,
i have checked with your setting also . its not working .

On 09/06/15 14:00, Prameswar Lal wrote:

output of curl is .

i have checked with your setting also . its not working .
    index.php start downloading .
        include fastcgi_params;

    http://mailman.nginx.org/mailman/listinfo/nginx

nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx
That confirms that you’re not attempting to process your php. Try
removing all host config files apart from this one ( in cond.f and
sites-enabled )

On Tue, Jun 09, 2015 at 07:30:13AM +0530, Prameswar Lal wrote:

Hi there,

i am sending current access log after changing according to steve block .

The config you showed does not write to access.log.

If the request you make does write to access.log, then the request you
make is not being handled by the config that you showed.

Can you start with a small complete config that clearly shows the
problem
you are reporting?

f

Francis D. [email protected]

Hi,

On 09/06/15 23:46, Prameswar Lal wrote:

problem

nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Look in your nginx.conf.

include /etc/nginx/conf.d/*.conf;

THIS is where your config file should reside.

yes , i had default file in /etc/nginx/sites-available/.
that i have remove so , now i getting "unable to connect " .

curl -I http://example.com/index.php
curl: (7) Failed to connect to example.com port 80: Connection refused

in my example.com.conf file there is one line " access_log
/var/log/nginx/nginx-access.log; " but i am not getting log here with
name
nginx-access.log .

i am attaching my error.log file. and access.log is empty here .

please see in my error.log.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs