How to configure nginx so that the front and back ends of different ports of the same domain name can interact with each other.

now the front end of my project is react, the back end is ssm, front end in localhost:3000, and the back end is in localhost:8080,
, that is, how to transfer the request of localhost:3000 to localhost:8080,
how to correctly set the location of nginx
the following is my location configuration:

   server { 
   listen 80; 
   
   server_name  localhost;

    -sharpcharset koi8-r;

    -sharpaccess_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm;  
    }

    -sharperror_page  404              /404.html;

    -sharp redirect server error pages to the static page /50x.html
    -sharp
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    -sharp proxy the PHP scripts to Apache listening on 127.0.0.1:80
    -sharp
    location ~ \.json$ {
        proxy_pass http://localhost:8080;
    }

    -sharp pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    -sharp
    -sharplocation ~ \.php$ {
    -sharp    root           html;
    -sharp    fastcgi_pass   127.0.0.1:9000;
    -sharp    fastcgi_index  index.php;
    -sharp    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    -sharp    include        fastcgi_params;
    -sharp}

    -sharp deny access to .htaccess files, if Apache"s document root
    -sharp concurs with nginx"s one
    -sharp
    -sharplocation ~ /\.ht {
    -sharp    deny  all;
    -sharp}
}

!!

api fix the prefix for your request and change it yourself

location /api {
  proxy_pass  http://localhost:8080/api;
}
For more information, please see https://www.thinktxt.com/ngin.

.

set reverse proxy

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e945aa-14d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e945aa-14d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?