AWX behind a reverse proxy cannot get it working!

Hello,

I have been reading and following this topic Is AWX behind a reverse proxy actually possible? to get my nginx reverse proxy to forward my awx web ui but it seems I cannot get this working.

I’ve got an nginx acting as reverse proxy running on a machine, serving some pages just fine and awx installed in another machine following the tutorial from here : GitHub - kurokobo/awx-on-k3s: An example implementation of AWX on single node K3s using AWX Operator, with easy-to-use simplified configuration with ownership of data and passwords.
AWX web ui works as expected if not behind the proxy but when tried to have it behind the nginx proxy i’m just getting a :

404 page not found

My nginx config looks like :

server {
    listen       80;
    server_name   awx.my.domain;

    return 301 https://$server_name$request_uri;
}

server {
        listen 443 ssl;
        server_name     awx.my.domain;

        client_max_body_size            16G;

        ssl_certificate /etc/nginx/ssl/cert.crt;
        ssl_certificate_key /etc/nginx/ssl/priv-key.key;
        ssl_session_timeout                     5m;                                                                                       
        ssl_protocols                           TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers                                     HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers       on;                                                                                               

    location / {
                proxy_pass                      https://192.168.3.2:443;
                proxy_set_header                Host $http_host;
                proxy_set_header                X-Forwarded-Host $host;
                proxy_set_header                X-Forwarded-Server $host;
                proxy_set_header                X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header                X-Original-Forwarded-For $remote_addr;
                proxy_set_header                X-Real-IP $remote_addr;
                proxy_redirect                  off;
                proxy_set_header                Connection "upgrade";
                proxy_set_header                Upgrade $http_upgrade;

    }
}

I’ve also added the Remote Host Headers in the web ui under settingsMiscellaneous System

[                                                                                                                                         
  "HTTP_TRUE_CLIENT_IP",                                                                                                                  
  "HTTP_X_FORWARDED_FOR",                                                                                                                 
  "REMOTE_ADDR",                                    
  "REMOTE_HOST"                                                      
]

But after doing all this getting the same result :

404 page not found

I’m sorry that i’m asking again the same thing that have been asked, maybe i’m a bit too silly and i couldn’t figure out what’s that i’m missing.
Would be great if someone could point me into the right direction.

Thank you very much.

Hello everyone,

I just wanted to ask if anyone would be able to help a little bit on this matter?

Thank you

You show your two server definitions but not your upstream definition. Our working solution looks something like this:

proxy_cache_path /data/nginx/awx/NGINX_cache/ keys_zone=awxcache:10m;

upstream our-awx {
    zone our-awx 64k;
    server awx1.our.domain:443;
    server awx2.our.domain:443;
    sticky learn
          create=$upstream_cookie_awxcookie
          lookup=$cookie_awxcookie
          zone=awxclient_sessions:1m;
}

We have two servers, but you can have just one server / one line.

Once we define the upstream, we reference it in the proxy_pass definition:

    location / {
        proxy_pass https://our-awx;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-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-Proto $scheme;
        proxy_cache awxcache;
. . . 

Hope this helps!