问题
when doing a post to let url = '/api/registerCoin'
it works.
nginx
forwards this to server:3000
, which is good!
When I try the post
to /api/updatePost
with params
nginx doesn't seem to point to the server.
I am getting:
/api/findPostData Failed to load resource: the server responded with a status of 404 (Not Found) in the browser.
Is that due to the params being added to the url? I am having the same issue making a post to:
POST https://v2.steemconnect.com/api/broadcast 500 ()
this seems not to route via server.
even though: https://v2.steemconnect.com/oauth2/authorize?client_id=cr
for oauth authentication does work from the same component.
This leads me to believe that I am doing something wrong with the 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;
}
}
}
来源:https://stackoverflow.com/questions/48180767/nginx-reverse-proxy-params-docker