Welcome Guest, Not a member yet? Register   Sign In
CI4 routes doesn't work on production server
#3

(This post was last modified: 11-13-2021, 10:49 AM by fujael.)

(11-08-2021, 01:54 PM)includebeer Wrote: It should work. Your server must be misconfigured.
"this doesn't work" doesn't mean anything. What does it do? What's the error message? Without any info it can be anything...

Hi
Thanks, I didn't made any special config for nginx server. It is - 

Code:
server {
    server_name  *.****.com;
    root          /home/user/web_test/htdocs;
    index          index.php index.html;

    location ~ \.php$ {
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    #try_files $uri =404;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #include snippets/fastcgi-php.conf;
    include fastcgi_params;
    add_header 'Cache-Control' no-store always;
    }
    location ~ /\.ht {
    deny all;
    }
    location ~ (\.log$|\.bkp){
        deny all;
    }
    error_page 502 /index.php?e=502;
    error_page 403 /index.php?e=403;

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


}
server {

    server_name  *.**.com;
    listen 80;


}

(11-08-2021, 01:54 PM)includebeer Wrote: It should work. Your server must be misconfigured.
"this doesn't work" doesn't mean anything. What does it do? What's the error message? Without any info it can be anything...

Also I should clarify -

I am trying to use autoroute feature. Guess I have `Blog` Controller with method `details`. If I manually set the route ->add('/blog/details/(:any)') then it works without trouble. But I want it to works automatically because I already have a method called `details`. Why I should implicitly configure it on `Routes.php` for the production server.
In localhost:8080 or `php spark serve` I didnot need to specify paths/routes to Routes.php but production level I have to specify. This is the issue here.
Reply


Messages In This Thread
RE: CI4 routes doesn't work on production server - by fujael - 11-13-2021, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB