我有一个使用以下结构运行的 Ubuntu Web 服务器:
Nginx 反向代理 localhost:80,重定向到当前'/'有效的任意一个(带有 WordPress 站点的 apache 服务器,位于 localhost:8080)。
最近,我尝试在www.site.com/app或内部添加 Node.js 应用程序localhost:3000。我能够为 Node.js Web 应用程序的 HTML 和 CSS 提供服务,但是所有内部路由调用都处于 404ing,可能是因为 /app/ 的 URL 寻址。
IE。尝试命中/someendpoint404,因为 Node.js 从技术上讲是在localhost:3000( www.site.com/app) 上运行的。我应该像 ( www.site.com/app/someendpoint) 这样路由参数吗?
问题:由于我对 NGINX 配置的理解不好,来自 NODE.JS 的所有 POST/GET 调用都是 404ing。如何将此 GET 调用路由到 Node.js 服务器的实际位置(site.com/app/,localhost:3000)。
这是我的“ default”配置/etc/nginx/available_sites/.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name www.*site*.name; …Run Code Online (Sandbox Code Playgroud)