0

Currently, I have a proxy server and an application server ( In the application server the actual code was deployed). The Nginx configuration file for the application server was given below. There are two different applications was running in the application server. Say example1.com is the first application and example2.com is the second application

So I need to write an Nginx rule in the proxy server (Is different server) so that both domains should be served as https.

    server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /location_1;
    index index.html index.htm index.nginx-debian.html;
    location /apicall
    {
    proxy_pass http://localhost:1111;
    }

    server_name example1.com;        
    }
    server {       
    root /location2;
    index index.html index.htm index.nginx-debian.html;
    location /apicall
    {
    proxy_pass http://localhost:1111;
    }
    server_name example2.com;        
     }

Currently, I have no idea how to write an Nginx rule in the proxy server to achieve the below problem.

ie HTTP://exampe1.com to https://exampe1.com and

HTTP://exampe2.com to https://exampe2.com

Note:

  1. proxy server was running on IP-1 and the application server was running on IP-2
  2. I have a wild card SSL
  3. Both domains example1.com and example2.com were resolved to the IP that of the proxy server (ie, IP-1)

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.