Welcome! Log In Create A New Profile

Advanced

set the communication between the front and the backend in prodcution environment

Posted by phoenix756 
set the communication between the front and the backend in prodcution environment
November 16, 2023 04:05AM
Hello, I am trying to make a connectio between a front-end developed in react and a backend in expressjs.

Here is my configuration:

server{

server_name mvp.greencarlane.com;
root /var/www/mvp.greencarlane.com/html;
index index.html index.htm;




location / {
try_files $uri $uri/ =404;
}

location /api/ {

# Add a trailing slash if missing
if (!-f $request_filename) {
rewrite [^/]$ $uri/ permanent;
}

proxy_pass http://149.100.159.217:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}

I get error 404 on GET
https://mvp.greencarlane.com/quiz
[HTTP/1.1 404 Not Found 275ms]

There is only the login route that is fucntioning when I reload the root
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready