Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

336
Views
Jenkins detrás del proxy inverso nginx no redirige en todas las situaciones

Tengo jenkins y nginx ejecutándose a través docker-compose y ambos están en la misma red docker. Jenkins no expone ningún puerto a la máquina host y tiene su configuración predeterminada de ejecución en el puerto 8080 y nginx maps 8003:443 .

Tenemos un servidor ubicado en una red privada y un subdominio y tengo el siguiente archivo de configuración nginx

 upstream jenkins { server jenkins:8080; } server { listen 443 ssl; server_name abc.example.com; ssl_certificate /etc/ssl/private/certificate.crt; ssl_certificate_key /etc/ssl/private/key.pem; root /var/run/jenkins/war/; ignore_invalid_headers off; #pass through headers from Jenkins which are considered invalid by Nginx server. location ~ "^/static/[0-9a-fA-F]{8}\/(.*)$" { #rewrite all static files into requests to the root #Eg /static/12345678/css/something.css will become /css/something.css rewrite "^/static/[0-9a-fA-F]{8}\/(.*)" /$1 last; } location /userContent { #have nginx handle all the static requests to the userContent folder files #note : This is the $JENKINS_HOME dir root /var/lib/jenkins/; if (!-f $request_filename){ #this file does not exist, might be a directory or a /**view** url rewrite (.*) /$1 last; break; } sendfile on; } location / { proxy_pass http://jenkins/; proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; sendfile off; proxy_redirect default; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port 443; proxy_max_temp_file_size 0; #this is the maximum upload size client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_set_header Connection ""; # Clear for keepalive } }

La mayoría de estas configuraciones se tomaron de la guía de resolución de problemas, ya que mi intento inicial no las enumeró todas y recibí y todavía recibo el aviso It appears that your reverse proxy set up is broken. Actualmente, parece estar funcionando solo parcialmente. Algunas direcciones URL funcionan bien, por ejemplo, si hago clic en personas, obtendré https://abc.example.com:8003/asynchPeople/ , pero otras como el inicio de sesión y el océano azul parecen abandonar el puerto. Agregar esto de nuevo manualmente hace que la URL funcione. Así que no estoy seguro exactamente de lo que está mal. También debo agregar que configuré la URL de jenkins en abc.example.com:8003

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Después de una buena cantidad de lectura, lo siguiente ayudó a mi situación.

 proxy_set_header X-Forwarded-Host $http_host;

Esto mantuvo el número de puerto y la funcionalidad parecía ser la esperada con Jenkins.

Con respecto a que el proxy inverso está roto, inspeccioné a través de curl la tarea de administración. Esto falló y me estaba dando el error y me redirigió aquí: https://curl.haxx.se/docs/sslcerts.html . Aunque todos los navegadores muestran el icono de seguridad y no presentan problemas.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!