B
B
beduin012017-02-19 20:24:56
Nginx
beduin01, 2017-02-19 20:24:56

How to prevent attempt to redirect to local url?

It is necessary to make it so that when accessing /foo, there is a transfer to the application listening on the port. Now nginx is trying to access /foo for this local application i.e. make 127.0.0.1:8080/foo, but it is necessary that the call goes simply to 127.0.0.1:8080
Here is my config:

server {
        listen       80;
        server_name  mysite.org;

        location /foo {
            proxy_pass  http://127.0.0.1:8080;
        }
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
15432, 2017-02-19
@15432

if i googled correctly, add a slash at the end :)
proxy_pass http://127.0.0.1:8080/;

N
Nurlan, 2017-02-20
@daager

How about adding to location?
try_files /;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question