D
D
danilr2019-07-13 07:59:52
Nginx
danilr, 2019-07-13 07:59:52

How to connect back and front SPA in nginx?

Here is my nginx conf

worker_processes  8;
error_log  logs/error.log  warn;
pid        logs/nginx.pid;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    client_max_body_size 150m;

    server {
        listen 80;
        server_name  localhost;

        location / {
            root   C:\OSPanel\domains\meatfood\dist;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }

         location ~ \.php$ {
            #root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}

Here is the request url by which I make a request to the back. Such a structure is a shared folder, it contains an ajax folder and a dist folder I beg you to help a newbie - zero in nginx, servers and php
url : '/ajax/send.php'
5d29650ce5d03834170855.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question