Securing authenticated API calls with NGINX reverse proxyHow to set up Nginx as a caching reverse proxy?Nginx reverse proxy + URL rewriteGo(lang) with nginx - Serving Static Filesnginx proxy with CASSecuring Kafka REST API endpointsWhy does my nginx proxy fail, but my node.js proxy works?How do I ensuring cache consistency between two Nginx edgesOverwrite HTTP headers comming back from a web application server proxied in nginxMy Web application gives CORS error after adding HTTPS using Let's EncryptNginx preventing cookie from being sent from front to back end

My advisor talks about me to his colleague

Proving n+1 th differential as zero given lower differentials are 0

Why does sound not move through a wall?

Emotional immaturity of comic-book version of superhero Shazam

How long would it take for people to notice a mass disappearance?

Is there an official reason for not adding a post-credits scene?

Manager is threatening to grade me poorly if I don't complete the project

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

Upside-Down Pyramid Addition...REVERSED!

Adjacent DEM color matching in QGIS

Are pressure-treated posts that have been submerged for a few days ruined?

Nominativ or Akkusativ

Do publishers care if submitted work has already been copyrighted?

Copy previous line to current line from text file

Appropriate certificate to ask for a fibre installation (ANSI/TIA-568.3-D?)

How can I get people to remember my character's gender?

Would you use "llamarse" for an animal's name?

What are the advantages of luxury car brands like Acura/Lexus over their sibling non-luxury brands Honda/Toyota?

What does "Managed by Windows" do in the Power options for network connection?

What is the solution to this metapuzzle from a university puzzling column?

Something that can be activated/enabled

Where can I go to avoid planes overhead?

Would glacier 'trees' be plausible?

Is bounce rate of a website a ranking factor?



Securing authenticated API calls with NGINX reverse proxy


How to set up Nginx as a caching reverse proxy?Nginx reverse proxy + URL rewriteGo(lang) with nginx - Serving Static Filesnginx proxy with CASSecuring Kafka REST API endpointsWhy does my nginx proxy fail, but my node.js proxy works?How do I ensuring cache consistency between two Nginx edgesOverwrite HTTP headers comming back from a web application server proxied in nginxMy Web application gives CORS error after adding HTTPS using Let's EncryptNginx preventing cookie from being sent from front to back end






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















First of all , apologies for being an Nginx newb. We utilize third-party API's that require authentication and we want to secure the API key by setting up a reverse proxy in Nginx. I'm pretty sure I get how to set up this part - create a location, proxy_pass it to the third-party server and add in authentication headers.



However, even though the API key is secure, at this point any user has full access to the API through the front-end URL, is that right? How I would I limit access to the proxied API to requests coming from the web server itself? Is adding a CORS header the correct solution here?



Part of my confusion is I'm not sure what is the 'origin' of a AJAX request in front-end code? Does it count as coming from the web server or from the user's computer, since code is executed in their browser?










share|improve this question




























    1















    First of all , apologies for being an Nginx newb. We utilize third-party API's that require authentication and we want to secure the API key by setting up a reverse proxy in Nginx. I'm pretty sure I get how to set up this part - create a location, proxy_pass it to the third-party server and add in authentication headers.



    However, even though the API key is secure, at this point any user has full access to the API through the front-end URL, is that right? How I would I limit access to the proxied API to requests coming from the web server itself? Is adding a CORS header the correct solution here?



    Part of my confusion is I'm not sure what is the 'origin' of a AJAX request in front-end code? Does it count as coming from the web server or from the user's computer, since code is executed in their browser?










    share|improve this question
























      1












      1








      1








      First of all , apologies for being an Nginx newb. We utilize third-party API's that require authentication and we want to secure the API key by setting up a reverse proxy in Nginx. I'm pretty sure I get how to set up this part - create a location, proxy_pass it to the third-party server and add in authentication headers.



      However, even though the API key is secure, at this point any user has full access to the API through the front-end URL, is that right? How I would I limit access to the proxied API to requests coming from the web server itself? Is adding a CORS header the correct solution here?



      Part of my confusion is I'm not sure what is the 'origin' of a AJAX request in front-end code? Does it count as coming from the web server or from the user's computer, since code is executed in their browser?










      share|improve this question














      First of all , apologies for being an Nginx newb. We utilize third-party API's that require authentication and we want to secure the API key by setting up a reverse proxy in Nginx. I'm pretty sure I get how to set up this part - create a location, proxy_pass it to the third-party server and add in authentication headers.



      However, even though the API key is secure, at this point any user has full access to the API through the front-end URL, is that right? How I would I limit access to the proxied API to requests coming from the web server itself? Is adding a CORS header the correct solution here?



      Part of my confusion is I'm not sure what is the 'origin' of a AJAX request in front-end code? Does it count as coming from the web server or from the user's computer, since code is executed in their browser?







      nginx reverse-proxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 25 at 9:01









      T NguyenT Nguyen

      1062




      1062




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964535%2fsecuring-authenticated-api-calls-with-nginx-reverse-proxy%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964535%2fsecuring-authenticated-api-calls-with-nginx-reverse-proxy%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos

          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020