Giter VIP home page Giter VIP logo

Comments (6)

lovewe avatar lovewe commented on July 18, 2024 1

你确定是这样配的,我咋觉得你的 nginx 配错了,没有代理 /api/。你本地启动 nginx,然后本地访问地址,nginx 不是用在本地的。

嗯嗯,这个是代理的前端地址,配置到后端地址的nginx server块中就可以了,谢谢大佬

from ai-beehive.

hncboy avatar hncboy commented on July 18, 2024

本地没遇到过这种情况,nginx 会出现。

from ai-beehive.

lovewe avatar lovewe commented on July 18, 2024

本地没遇到过这种情况,nginx 会出现。

我是在本地用nginx启动的,请求是什么原因啊?该怎么解决呢?

from ai-beehive.

hncboy avatar hncboy commented on July 18, 2024

ngxin 配置中添加 proxy_buffering off;

from ai-beehive.

lovewe avatar lovewe commented on July 18, 2024

ngxin 配置中添加 proxy_buffering off;

server {
listen 80;
server_name _;
proxy_buffering off;
access_log /var/log/nginx/access.log combined;
gzip on;
gzip_comp_level 5;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
index index.html index.htm index.jsp index.php;
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin *;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

大佬,我是这样配置的,不起作用啊

from ai-beehive.

hncboy avatar hncboy commented on July 18, 2024

你确定是这样配的,我咋觉得你的 nginx 配错了,没有代理 /api/。你本地启动 nginx,然后本地访问地址,nginx 不是用在本地的。

from ai-beehive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.