回答
收藏
分享
举报
NGINX LOCATION问题
提问于2022-02-02 13:44

浏览 594

文章标签

安装一个nginx,有静态网页(端口是22222),后台有一个服务(前台可以调用它的HTTP API,端口是8888

写了一个跳转的location,但是显示报错还是http://150.138.84.46:22222/api/db/v1/getmode 404 no found?

nginx的default.conf

location /api/db/v1/ {

proxy_pass http://localhost:8888;
proxy_set_header Host $host:$server_port;
proxy_redirect off;
proxy_http_version 1.1;

已修改于2023-03-16 02:24



写下您的回答
发表回答
全部回答(1)

按点赞数排序

按时间排序

proxy_pass http://localhost:8888/;

8888后面加`/`

赞同

0

回复举报

回答于2022-02-10 10:48



回复小厮
回复
提问者
ag9025
这家伙很懒还未留下介绍~
0
文章
1
问答
0
粉丝
相关问答

默认采用RoundRobin算法,主要基于TCP层和HTTP层实现健康检查。

其中,TCP层通过在建立连接、发送、接收消息时实现健康检查;HTTP层主要通过response code实现;一旦出错,会启动next upstream机制去解决错误。

点赞 0
浏览 1.2k

浏览器页面OOM,要从JS代码查起。比如Chrome里的任务管理器有JavaScript Memory 

点赞 0
浏览 999

不应该这么来弄,应该是结合lua/njs来做,通过njs/lua来判断文件是否存在

error_log stderr notice;
daemon off;
events { }

http {
include /usr/local/openresty/nginx/conf/mime.types;

server {
listen 80;

location @image_server {
content_by_lua_file "file_judge.lua";
}

location ~ ^/images/(?<sig>[^/]+)/(?<size>[^/]+)/(?<path>.*\.(?<ext>[a-z_]*))$ {
root cache;
set_md5 $digest "$size/$path";
try_files /$digest.$ext @image_server;
}
}

}

-- make sure the file exists
local file = io.open(source_fname)

if not file then
return_not_found()
end

file:close()

lua里面去判断文件存不存在

点赞 0
浏览 656