Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地启动的,回答的答案是等了一会一下全部展示,而不是一个字一个字的展示 #68

Closed
lovewe opened this issue May 6, 2023 · 6 comments

Comments

@lovewe
Copy link

lovewe commented May 6, 2023

如题,请问是有什么配置吗?还是什么原因导致的啊

@hncboy
Copy link
Owner

hncboy commented May 6, 2023

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

@lovewe
Copy link
Author

lovewe commented May 6, 2023

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

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

@hncboy
Copy link
Owner

hncboy commented May 6, 2023

ngxin 配置中添加 proxy_buffering off;

@lovewe
Copy link
Author

lovewe commented May 6, 2023

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;
}
}

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

@hncboy
Copy link
Owner

hncboy commented May 6, 2023

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

@lovewe
Copy link
Author

lovewe commented May 9, 2023

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants