Comments (9)
咋配置的,nginx 反向代理 node 可以成功?
from ai-beehive.
我是打包之后的静态代码,不是代理node
from ai-beehive.
我试了 nginx 代理 api 没问题。
from ai-beehive.
from ai-beehive.
localhost 改为 ip
from ai-beehive.
我也遇到了一样的问题
location /api {
# 处理 Node.js 后端 API 的请求
proxy_pass http://127.0.0.1:3002/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
请求 URL: http://127.0.0.1:8089/api/session
请求方法: POST
状态代码: 404 Not Found
远程地址: 127.0.0.1:8089
引用者策略: strict-origin-when-cross-origin
提示404
from ai-beehive.
我也遇到了一样的问题
location /api { # 处理 Node.js 后端 API 的请求 proxy_pass http://127.0.0.1:3002/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Nginx-Proxy true; proxy_redirect off; }
请求 URL: http://127.0.0.1:8089/api/session 请求方法: POST 状态代码: 404 Not Found 远程地址: 127.0.0.1:8089 引用者策略: strict-origin-when-cross-origin
提示404
127.0.0.1 改到其他网卡 ip
from ai-beehive.
server {
listen 8089;
server_name localhost;
charset utf-8;
error_page 500 502 503 504 /50x.html;
location / {
root html;
try_files $uri /index.html;
}
location /api {
proxy_set_header X-Real-IP $remote_addr; #转发用户IP
proxy_pass http://192.168.0.18:3002;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
还是不行报404
from ai-beehive.
错误:location /api
正确:location /api/
经测试api前后均需要加斜杠,location节点下的配置只要IP端口不错就没问题
from ai-beehive.
Related Issues (20)
- docker中的日志文件在哪呀 没找到 HOT 1
- 请问下大家yml中api_reverse_proxy参数如何配置 HOT 1
- MJ V 操作后无法再次 UV
- v1.1.0 AccessToken 模式报错
- 打包为dist并部署到nginx后,前端无法显示实时聊天内容 HOT 2
- 为什么要限制对话的消息的总长度呢? HOT 6
- 增加对百度文心千帆大模型的支持
- NewBing 无法使用修复
- NewBing 待修复
- 发出后的信息没有换行了,出现平台和百度文心一言后台返回结果不一样。
- 前端每次读取内容,会偶尔出现 读取一半的json数据 HOT 1
- 增加 ChatGLM2-6B 开源模型
- Hardcoded Vulnerabilities HOT 2
- 代理地址的端口号怎么填写 HOT 3
- Midjourney参数配置都正确了,但是请求发到Discord的时候连接关闭 HOT 1
- 2.0.0 版本 chat_room,chat_message,/rate_limit 等接口404 HOT 1
- 将配置文件以JSON形式存入数据库的目的是什么? HOT 1
- token 验证目前存在bug 各种路径未生效 HOT 1
- 后端只有客户端接口,没有管理端接口吗 HOT 1
- 体验版发送消息报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ai-beehive.