在做帖子时让url = '/api/registerCoin'
有效。
nginx
将此转发给server:3000
,这很好!
当我用params尝试post
到/api/updatePost
时
nginx似乎没有指向服务器。
我得到了:
/api/findPostData Failed to load resource: the server responded with a status of 404 (Not Found) in the browser.
是否由于params被添加到url? 我有同样的问题发帖到:
POST https://v2.steemconnect.com/api/broadcast 500 ()
这似乎不是通过服务器路由。
即使:https://v2.steemconnect.com/oauth2/authorize?client_id=cr
oauth身份验证可以在同一个组件中运行
这让我相信我对nginx conf
做错了。
var dilta = this.quill.getContents();
let url = '/api/updatePost';
const params = new HttpParams().set('permlink', permlink);
return this.http.post(url ,dilta,{ params })
worker_processes 2 ;
events {
worker_connections 1024;
}
http {
upstream my-server {
server myserver:3000;
}
upstream client {
server client:4200;
}
server {
listen 80;
location / {
proxy_pass http://client;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ^~ /api/* {
proxy_pass http://my-server;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
}