2

I am having 3 Server: A, B, C. Details are:

  1. Server A: NGINX Server, URL: https://test1.example.com
  2. Server B: NGINX Server hosting NodeJS Web Application, URL: http://test2.example.com
  3. Server C: Apache2 Server hosting Django Web Application, URL: http://test3.example.com

Server A(NGINX Server) is front facing public facing server acting as load balancer using proxy_pass. Server B(NGINX Server) is having a form and submitting it through POST request to Server C(UWSGI Django Server using Apache2). The request is from Server B with url: https://test1.example.com/register to Server C but Server A is converting it to GET request.

So I am getting 2 request log one with POST and other with GET with same path "/register"

The setup is depicted in figure (Diagram is at the end of the post).

The configuration is as follows:

  1. Server A:

    server {
    
       listen 443 ssl http2;
       listen [::]:443 ssl http2;
       server_name test1.example.com;
    
        ssl_certificate /etc/ssl/test1/test1.example.com.crt;
        ssl_certificate_key /etc/ssl/test1/test1.example.com.key;
    
       # Proxy/Loadbalancer configuration`
    
       # Testing the request`
    
            location / {
              proxy_pass http://test2.example.com;
            }
    
            location /register/{
                    proxy_pass http://test3.example.com;
            }
    }
    
  2. Server B:

    server {
    
        listen 80 default_server;
    
        listen [::]:80 default_server;
    
        root /var/www/html;
    
        # Add index.php to the list if you are using PHP
        index index.html index.htm;
    
        server_name test2.example.com;
    
        location / {
                #try_files $uri $uri/ =404;
                 try_files $uri $uri/ /index.html;
        }
    
        access_log /var/log/nginx/access.log;
        error_log  /var/log/nginx/error.log;
    

    }

  3. Server C:

    <VirtualHost *:80>
    ServerName  test3.example.com
    ServerAdmin admin@example.com
    DocumentRoot /var/www/test
    
    Alias /static/  /var/www/test/webapp/static/
    Alias /media/  /var/www/test/media/
    
    WSGIScriptAlias /   /var/www/test/webapp/wsgi.py
    WSGIDaemonProcess   cdac.in  python-path=/var/www/test \
        python-home=/var/www/test/venv  processes=5   threads=8
    WSGIProcessGroup cdac.in
    <Directory /var/www/test/webapp/>
        Options -Indexes
        Order deny,allow
        Allow from all
        Require all granted
    </Directory>
    
    LogLevel info
    
    # PROJECT_NAME is used to separate the log files of this application
    ErrorLog    /var/log/apache2/error.log
    CustomLog   /var/log/apache2/access.log combined
    

Where am I going wrong.

Setup Diagram

0 Answers0