Configure proxy with NGINX?

0

I would like to configure NGINX so that the traffic that enters link goes to an address link .

Is this implementation correct, or would it need more configuration parameters ?:

location /ruta/ {
    proxy_pass    http://nombre.equipo/carpeta/;
}
    
asked by Pelayo 22.11.2018 в 10:35
source

1 answer

1

I have it configured for several services in my Pi and at least for me to work, the configuration has been somewhat more complex, I'll give you an example of how I have the proxy configured so that when I enter the url "admin .mombredemidominio.com "redirect me to a local url that is my router:

# Router Admin Page
#server {
  listen 0.0.0.0:80;
  server_name admin.nombredemidominio.com;
  location / {
    proxy_pass http://192.168.1.1:80;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true; proxy_redirect off;
  }
}

In your case, you should change the server_name by name.equipment / folder / and the statement proxy_pass by link .

I hope it helps you.

Greetings.

    
answered by 22.11.2018 / 12:25
source