pinodex / openshift-cartridge-nginx-php7

DISCONTINUED (see https://blog.openshift.com/migrate-to-v3-v2-eol/). OpenShift Cartridge for Nginx and PHP 7.
Other
55 stars 32 forks source link

404 error #7

Closed limatheus closed 8 years ago

limatheus commented 8 years ago

Hi, First I need say thanks for this cartridge, it's awesome. Thank you.

Here is my problem, when I try deploy a Laravel app to the Openshift any route except '/' returns me a 404 error.

I try some things, like: in /template/config/nginx.d/default.conf.erb change the try_files $uri =404;

To try_files $uri $uri/ /index.php?$query_string; Or try_files $uri $uri/ /index.php$is_args$args;

I try many others ways, but nothing.

Can you help me?

pinodex commented 8 years ago

Is the 404 error from Nginx or Laravel?

limatheus commented 8 years ago

@pinodex It's from Nginx. In localhost (also PHP 7.0.8 and Nginx) work's pretty fine, any route is accessible.

pinodex commented 8 years ago

I'm using this for my Laravel app

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

Check if the deployed config file is the one you edited. If you are creating the app with this cartridge (not forked), clone your OpenShift app, then edit config/nginx.d/default.conf.erb. Otherwise, if you are creating from a fork of this cartridge, make sure to change the cartridge definition to http://cartreflect-claytondev.rhcloud.com/github/<username>/openshift-cartridge-nginx-php7.

limatheus commented 8 years ago

Ok, I will try this. Thanks in advance.

baddwin commented 7 years ago
    try_files $uri $uri/ /index.php$is_args$args;

that should be written in the template file instead of try_files $uri $uri/ =404;