0

I am facing a problem with revamping the project from React + Nginx to Next.js.

From my old project, the Nginx has a reverse proxy to redirect all API requests to another API server.

location /api/ {
    resolver 127.0.0.11 valid=30s;

    set $${fake}upstream_api ${NGINX_API_PROTO}://${NGINX_API_HOST};
    rewrite ^/api/(.*) /$${fake}1 break;
    proxy_pass $${fake}upstream_api$${fake}uri$${fake}is_args$${fake}args;

    include /etc/nginx/json/api_json_errors.conf;
}

Is it possible to using Next.js to do this job instead of Nginx?

  • 1
    Does this answer your question? [Proxy to backend with default Next.js dev server](https://stackoverflow.com/questions/60925133/proxy-to-backend-with-default-next-js-dev-server) – juliomalves Sep 16 '21 at 18:08

0 Answers0