Score:0

How Nginx Sends reuests?

mx flag

i am new to nginx and currently i am using nginx as a reverse proxy , we are using nginx to route the request to other urls , For example i have below code ,

location /test/rome/ {

   
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        #remove this line if you application does not depend
        proxy_set_header X-HttpRouter-REMOTEADDR  $remote_addr;

        proxy_pass http://test.com/1234/test2/;

So in the above config i am saying any requests comes to /test/rome should redirect the request to the proxy pas url ? Is that mean do i need to open the FW connectivity from nginx servers to the server mentioned in proxy_pas ?

Richard Smith avatar
jp flag
This `location` block does not match the URI `/test/rome` The trailing `/` is significant. If you want to handle `/test/rome` with `test.com`, you need to remove the trailing `/` from the `location` and `proxy_pass` statements.
Score:1
us flag

Yes, this setup proxies requests with prefix /test/rome to the URL specified in proxy_pass.

And yes, nginx on the server needs to be able to open TCP connection to the destination server.

Prakash avatar
mx flag
Thank you this was exactly i needed
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.