Nginx Reverse Proxy Configuration

I need nginx for return GET and POST form requests:

/myapp/path/to/resource 

at

http://127.0.0.1:9090/path/to/resource

I am trying to do the following:

location /myapp/(.*) {
  rewrite $1;
  proxy_pass http://127.0.0.1:9090;
}

but nginx returns an HTTP 405 error [not allowed].

Any ideas on how to fix this? Thank.

+3
source share
1 answer

In fact, you do not need to rewrite. You can achieve the same goal with the following:

location /myapp/ {
  proxy_pass http://127.0.0.1:9090/;
}
+4
source

Source: https://habr.com/ru/post/1760161/


All Articles