<div dir="ltr"><p class="MsoNormal">Hi,<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">I have a VM with ip 10.130.0.198 (ssh will work within vpn)<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">And I have another ip XXX.XXX.XXX.XXX (public ip, visible to
all in internet).<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">So I have a load balancer configuration as below,<span></span></p>

<p class="MsoNormal" style="text-indent:0.5in">Reaching to 80 port of
XXX.XXX.XXX.XXX will internally reach 10.130.0.198 80<span></span></p>

<p class="MsoNormal" style="text-indent:0.5in">Reaching to 443 port of
XXX.XXX.XXX.XXX will internally reach 10.130.0.198 80<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">And externally <span></span></p>

<p class="MsoNormal">               
Reaching to http port will be redirected to https port for XXX.XXX.XXX.XXX<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Now below is my nginx configuration file.<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal"><span style="background:silver">server
{<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
listen 80 ;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver"><span> </span></span></p>

<p class="MsoNormal"><span style="background:silver">   
server_name 10.130.0.198;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
if ($http_x_forwarded_proto = '') {<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">       
set $http_x_forwarded_proto  $scheme;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
}<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
## Application specific logs<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
## access_log /var/log/nginx/artifactory.net.nokia.com-access.log timing;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
## error_log /var/log/nginx/artifactory.net.nokia.com-error.log;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
rewrite ^/$ /artifactory/webapp/ redirect;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
chunked_transfer_encoding on;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
client_max_body_size 0;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
location /artifactory/ {<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_read_timeout  900;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_pass_header   Server;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_cookie_path   ~*^/.* /;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_pass          <a href="http://10.130.0.198:8081/artifactory/">http://10.130.0.198:8081/artifactory/</a>;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_set_header    X-Artifactory-Override-Base-Url
$http_x_forwarded_proto://$host:$server_port/artifactory;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_set_header    X-Forwarded-Port  $server_port;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_set_header   
Host             
$http_host;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
proxy_set_header    X-Forwarded-For  
$proxy_add_x_forwarded_for;<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">   
}<span></span></span></p>

<p class="MsoNormal"><span style="background:silver">}</span><span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">My artifactory application in deployed using docker in port
8081.<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">But when I do a docker login, nginx always returns 405 not
found. But the web UI works find with both the ip’s.<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Is there anything wrong with my nginx configuration. Can
someone help.<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Thanks,<span></span></p>

<p class="MsoNormal">Syed<span></span></p></div>