如何为ipfs网关设置nginx?

如何为ipfs网关设置nginx?,nginx,ipfs,Nginx,Ipfs,我需要通过安装certbot的nginx使ipfs http网关,并将WebSocket重定向到端口9999,但我无法使其按预期工作 运行websocket服务的代码位于“location/”上。 ipfs网关的代码位于“位置/ipfs” 我的自定义代码: location /ipfs { proxy_pass http://0.0.0.0:9001; proxy_set_header Host $host; proxy_cache_bypass

我需要通过安装certbot的nginx使ipfs http网关,并将WebSocket重定向到端口9999,但我无法使其按预期工作

运行websocket服务的代码位于“location/”上。 ipfs网关的代码位于“位置/ipfs”

我的自定义代码:

location /ipfs {
        proxy_pass http://0.0.0.0:9001;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        allow all;
     }
不按预期工作


我希望有一个ipfs网关可以通过https:recall访问。network/ipfs/HASH*解决方案是在位置中放置正确的前缀^

location ^~ /ipfs {
        proxy_pass http://0.0.0.0:9001;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        allow all;
     }

解决方法是在位置中放置正确的前缀^~

location ^~ /ipfs {
        proxy_pass http://0.0.0.0:9001;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        allow all;
     }

什么不起作用?ipfs路径解析不正确。我至少找到了一个解决方案,谢谢。什么不起作用?ipfs路径没有正确解析。我至少找到了解决办法,谢谢