Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

241
Vistas
nginx reverse proxy to localhost

I have application running on my AWS EC2 Instance's localhost:8080.

In order to use these Web portal, I have install nginx on EC2 and reversed proxy localhost so that I can access Web UI on my browser.

Nginx.conf file

server {
    listen 80;
    server_name ec2-xx-xx-xxx-xxx.eu-central-1.compute.amazonaws.com;

    location / {
    proxy_pass http://localhost:8080;

   location /$request_uri {
   proxy_pass http://localhost$request_uri;

} 

}

When hitting EC2 URL on my browser,I successfully seeing homepage of application.

But when I hit any url let's say /admin, Nginx redirects to my local computer's localhost:8080/admin not Server's localhost. All i want is that when hit any url nginx should forward the request to localhost:8080{$URL} and return me the browser.

please suggest where I'm wrong. Thanks In Advance.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You don't need to add the second location.

location / {
    proxy_pass http://localhost:8080;
    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-Forwarded-Proto $scheme;
}

this should be enough to access anything you need.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda