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

198
Views
Http response 401 accessing service behind nginx reverse proxy

I have a spring boot application hosting restful services that sits behind an Nginx reverse proxy. The Nginx configuration lets accepts requests on http://mynginx/proxy/ and proxies them transparently to http://host/service/. The target service is secured and requires the Oauth token in the Authorization header. When I call the service directly using GET http://host/service it works as expected however. The same with different destination GET http://mynginx/proxy gives a 401 unauthorized HTTP response. I ultimately want to lock down my application so it is not publicly accessible so do not want to expose the target service directly. What do I need to do to get Authorization working through Nginx?

Here is my Nginx configuration for this service call

        location /proxy/ {
          proxy_pass http://host/service/;
          proxy_redirect     off;
          proxy_set_header   Host $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-Host $server_name;
          proxy_http_version 1.1;
          proxy_set_header   Upgrade $http_upgrade;
          proxy_set_header   Connection "upgrade";  
          proxy_set_header   Authorization $http_authorization;
          proxy_pass_header  Authorization;   
        }
over 4 years ago · Santiago Trujillo
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!