Jump to content
Froxlor Forum
  • 0

Froxlor + NginX + Magento = 404 Error


vupibi

Question

Hello,

 

I have an Ubuntu Server running on 12.04 with NginX and Froxlor. When I only install NginX i am able to run Magento over NginX without any problems. But when i install Froxlor and then Try to set up Magento, it gives me on every site an "404 Not Found" NginX error.

So it seems Froxlor changes anything on my NginX configuration but I dont know what and why.

 

The weird thing is it only happens with Magento, everything else is still working fine...

 

Does anybody have an Idea? 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

you mean special configuration settings in froxlor? 

indeed, thats my question. i didn't found anything on google so i think regularly it should work. 

So when i set up my Server i first install nginx, then magento = working!

when I install nginx, froxlor, then magento = not working. Never mind if i set up magento in the customer folder of froxlor or in the nginx root directory, both not working.

Link to comment
Share on other sites

My /etc/nginx/sites-available/default

server {
    listen 80 default ;
    server_name localhost;
    root usr/share/nginx/www;


    ## allow for html source of super high volume product pages to be put in "static" directory and served without php
    if ($http_host ~ "^(.*)yourdomain.com"){
        set $rule_0 1;
    }
    if ($uri ~ "^(.*)$"){
        set $rule_0 2$rule_0;
    }
    if ($http_referer !~* ".*yourdomain.com"){
        set $rule_0 3$rule_0;
    }
    if (-f $document_root/static$request_uri){
        set $rule_0 4$rule_0;
    }
    if ($rule_0 = "4321"){
        rewrite ^/.*$ /static/$request_uri last;
    }


    ## Images and static content is treated different
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
            access_log        off;
            expires           30d;
            root usr/share/nginx/www/magento/production/web/;
    }


    location / {
        index index.html index.php; ## Allow a static html file to be shown first
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
    }


    ## These locations would be hidden by .htaccess normally
    location magento/app/                { deny all; }
    location magento/includes/           { deny all; }
    location magento/lib/                { deny all; }
    location magento/media/downloadable/ { deny all; }
    location magento/pkginfo/            { deny all; }
    location magento/report/config.xml   { deny all; }
    location magento/var/                { deny all; }
    location magento/nginx-config/       { deny all; }


    location  / { ## Disable .htaccess and other hidden files
        return 404;
    }


    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }


    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }


    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss


        expires        off; ## Do not cache dynamic content
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_read_timeout 120;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE yourdomain_store;
        fastcgi_param  MAGE_RUN_TYPE store;


        include        fastcgi_params; ## See /etc/nginx/fastcgi_params
    }


  access_log /var/log/nginx/yourdomain.com-access_log combined;
}

My /etc/nginx/nginx.conf 

 

user www-data;
worker_processes  4;




pid /var/run/nginx.pid;




events {
worker_connections  1024;
}




http {
include       /etc/nginx/mime.types;
default_type  application/octet-stream;












log_format  main  '$remote_addr - $remote_user [$time_local] "$request "'
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';












access_log  /var/log/nginx/access.log;




sendfile        on;
autoindex off;
map $scheme $fastcgi_https { ## Detect when HTTPS is used
        default off;
        https on;
    }




keepalive_timeout  65;




gzip  on;
gzip_comp_level 2;
    gzip_proxied any;






include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

NginX Error.log says the following:

 

2013/09/04 14:55:33 [error] 5302#0: *1 "/usr/share/nginx/www/magento/index.php/install/index.php" is not found (20: Not a directory), client: XXX.XXX.XXX.XX, server: localhost, request: "GET /magento/index.php/install/ HTTP/1.1", host: "XX.XXX.XX.XX"
 

 

do you need anything else?

Link to comment
Share on other sites

your 'default' isn't a system default config. There are lots of magento-relevant setting in there - there you got your solution. Check the froxlor generated vhost, check what's missing, enter missing entries in the "custom vhost entries" for the domain and it'll work 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...