R
R
Ruslan Absalyamov2018-09-24 16:45:41
Nginx
Ruslan Absalyamov, 2018-09-24 16:45:41

Why is my page empty?

I pulled the project and configured nginx. But for some reason, when I open the initial page, I open an empty page and there is nothing on it, if I turn php artisan serveit on, then the link does everything.
My nginx file

server {
  listen 80 default_server;
  
  server_name latina.site;

  root /home/ruslan/Разработка/latina/admin/public;
  index index.html index.php index.htm;

  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Content-Type-Options "nosniff";

  location = /favicon.ico { access_log off; log_not_found off; }
  location = /robots.txt  { access_log off; log_not_found off; }

  error_page 404 /index.php;

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  }

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

  location ~ /\.(?!well-known).* {
    deny all;
  }
}

Made a symbolic link to the /etc/nginx/sites-enabled directory. In this directory, I also deleted the defaul.
See if there are any errors in the code
[email protected]:/etc/nginx/sites-available$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

restarted nginx Rewrote sudo service nginx reload
the path in /etc/hosts
127.0.0.1 latina.site
But I just have an empty page displayed, I don’t understand how to make it appear as when creating a server on artisan

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ainur Valiev, 2018-09-24
@vaajnur

enable php logging

A
Andrey Gavrilov, 2018-09-25
@thexaver

php artisan serve is a php webserver, of course it will work, check the nginx logs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question