giorg
1 year ago

right nginx conf

Posted 1 year ago by giorg

Hi,

on my ubuntu 18 with php 7.2 this is my nginx conf:

server { listen 80; listen [::]:80; root /var/www/setonline/public; index index.php index.html index.htm; server_name setonline.test;

client_max_body_size 100M;


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

location ~ \.php$ {
   #try_files $uri /index.php =404;
   try_files $uri =404;
   fastcgi_split_path_info ^(.+\.php)(/.+)$;
   fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
   fastcgi_index index.php;
   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   include fastcgi_params;

} }

only / is working, every other route gives 404. What am I doing wrong?

thanks

Please sign in or create an account to participate in this conversation.