XtReLL
@XtReLL

Как подружить Angular и Laravel?

Здравствуйте. При настойке сервера возникла проблема выбора, к какому из 2 файлов (index.php и index.html) j обращаться. Дело в том, что index.php(laravel) подключается к базе, а index.html(angular) к самому проекту. Как настроить, что бы они работали вместе.

NGNIX конфиг.
server {
listen 80;
server_name candy-cases.com www.candy-cases.com;
access_log /var/log/access.log;
error_log /var/log/error.log;
rewrite_log on;
root /var/www/candy-cases.com/public;
index index.html index.htm index.php;
location / {
	try_files $uri $uri/ /index.php?$query_string;
	#expires -1;
        #add_header Pragma "no-cache";
        #add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
        #try_files $uri $uri/ /index.html ;
}
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location ~* \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
expires 365d;
}
error_page  405     =200 $uri;
}


.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine on

    # Don't rewrite files or directories
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Rewrite everything else to index.html
    # to allow html5 state links
    RewriteRule ^ index.html [L]
</IfModule>


5c7d5b6594c63497295467.png
  • Вопрос задан
  • 322 просмотра
Пригласить эксперта
Ответы на вопрос 1
tetra
@tetra
Человек оркестр
Просто поместите все в index.php.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы