mobile CCTV,mobile surveillance,police body worn cameras
标题:
平台API经过转发之后404
[打印本页]
author:
yixu
time:
2022-8-1 18:48
标题:
平台API经过转发之后404
各位大神,平台API经过转发之后404。localhost:9780页面能正常访问。接口调用也正常。比如这个地址:
localhost:9780/bvcsp/v1/dialog/device/webrtc
但是经过了本地nginx转发后,192.168.204.101/vvv1/
bvcsp/v1/dialog/device/webrtc地址调用出现404。直接
192.168.204.101/vvv1地址也是404。
各位大神是否遇到过这个问题。下面附上nginx配置
server {
listen 80;
server_name 192.168.204.101;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/html/gujing;
index index.html index.htm;
}
location /server {
proxy_pass http://localhost:8089;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /vvv1 {
proxy_pass http://localhost:9780;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
author:
dingjian
time:
2022-8-2 10:27
请参考这个配置
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~* ^/(jichang) {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods *;
add_header Access-Control-Allow-Headers *;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass
http://192.168.88.11:9780;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 1500s;
proxy_send_timeout 1500s;
proxy_read_timeout 1500s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
rewrite ^/jichang/(.*)$ /$1 break;
}
author:
fanghj90
time:
2022-8-2 10:29
你好,这样配置,我们后台收到的路径会多个/vvv1,导致找不到资源。
rewrite ^/vvv1/(.*)$ /$1 break;
[attach]3271[/attach]
欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/)
Powered by Discuz! X3.2