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

在现有的nginx下新建 location 通过nginx的默认端口访问报错 #27

Closed
channerchen opened this issue Jan 30, 2021 · 9 comments

Comments

@channerchen
Copy link

{"code":400,"data":null,"message":"找不到 Key 对应的 DeviceToken, 请确保 Key 正确! Key 可在 App 端注册获得。"}

信息如上 直接打开机器的8080端口没问题
咋处理呢 已有自带的证书

@channerchen channerchen changed the title 在自由的nginx下新建 location 通过nginx的默认端口访问报错 在现有的nginx下新建 location 通过nginx的默认端口访问报错 Jan 30, 2021
@channerchen
Copy link
Author

nginx配置如下

server {
listen 80;
listen 443 ssl;
ssl_certificate /usr/local/cert/4414204.pem;
ssl_certificate_key /usr/local/44142044.key;
server_name home.cc.online;

    location /bark {
        log_not_found on;
        proxy_pass http://127.0.0.1:8080;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_redirect off;
        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
    }

@Finb
Copy link
Owner

Finb commented Feb 1, 2021

location /bark/ {
     proxy_pass http://127.0.0.1:8080/;
}

改成这样试试

@channerchen
Copy link
Author

location /bark/ {
     proxy_pass http://127.0.0.1:8080/;
}

改成这样试试

还是不可以呢~

@Finb
Copy link
Owner

Finb commented Feb 2, 2021

@channerchen 你再将你完整的配置文件发一下我看看

@channerchen
Copy link
Author

channerchen commented Feb 2, 2021

nginx.txt

在开源项目pingos上改了conf的配置, pingos就是一个支持hls h265 rtmp的nginx

@Finb
Copy link
Owner

Finb commented Feb 2, 2021

@channerchen

location /bark/   <----- 注意加上后面这个 /  {
     proxy_pass http://127.0.0.1:8080/;    <----- 注意加上后面这个 / 
}

我看了你发的,你好像改错了,我是想让你在这两个位置加上 / ,其他都不变

@channerchen
Copy link
Author

channerchen commented Feb 3, 2021

加了两个斜杠就行了,莫非是权限问题。 谢谢哈

@mritd
Copy link
Collaborator

mritd commented Feb 3, 2021

加了两个斜杠就行了,莫非是权限问题。 谢谢哈

不是... 代码框架不那么智能,后面我重写一下🤪

@channerchen
Copy link
Author

加了两个斜杠就行了,莫非是权限问题。 谢谢哈

不是... 代码框架不那么智能,后面我重写一下🤪

哈哈哈 已经很好了。 多年运维经验没查来 实属自己大意了

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

3 participants