So we had a contractor set up nginx on an Azure-based Windows 2016 server which we wound up for the purpose. Now I'm trying to get my head around how to use it (and, ultimately, to fold back into our existing servers.)

The goal is to be able to have an IFRAME on our site with a 3rd party's site in it. Right now that doesn't work because of a "same-origin" restriction. We've asked the 3rd party to add use to the list of permitted servers but here we are three years later and no add.

So we thought we'd try the reverse-proxy approach. Now we have nginx on a server with the following nginx.conf (redacted):

    server {
        listen       80;
        server_name  localhost;

        location / {
            proxy_pass https://www.3rdparty.com/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host 3rdparty.com;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_cache_bypass $http_upgrade;

The contractor left IIS's binding at ":8081" for the default website.

How do we use this? What has to change in IIS, if anything, and in the nginx.conf?

  • What you described is an incomplete image of a solution as well as a portion of the original problem. That makes it a tough question to discuss.
    – Lex Li
    Jul 16, 2020 at 4:38
  • That's not surprising; I'm not at all sure what's needed. What else should I include?
    – bugmagnet
    Jul 16, 2020 at 4:56
  • 2
    SAP seems to have a good article on the topic, blogs.sap.com/2013/06/29/… where you should try to digest the theory carefully. That article uses Apache as reverse proxy, but literally any web server (Apache, IIS, nginx) supports reverse proxy setup, so the same theory applies to all of them. Your contractor probably didn't know IIS can be used as reverse proxy, and introduced nginx to mess things up.
    – Lex Li
    Jul 16, 2020 at 5:03
  • @LexLi Thanks. Reading now.
    – bugmagnet
    Jul 16, 2020 at 5:08


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.