Nginx configuration with artifactory

Syed Imran smart.imran003 at gmail.com
Fri Oct 6 14:00:26 UTC 2017


Hi,



I have a VM with ip 10.130.0.198 (ssh will work within vpn)



And I have another ip XXX.XXX.XXX.XXX (public ip, visible to all in
internet).



So I have a load balancer configuration as below,

Reaching to 80 port of XXX.XXX.XXX.XXX will internally reach 10.130.0.198 80

Reaching to 443 port of XXX.XXX.XXX.XXX will internally reach 10.130.0.198
80



And externally

                Reaching to http port will be redirected to https port for
XXX.XXX.XXX.XXX



Now below is my nginx configuration file.



server {

    listen 80 ;



    server_name 10.130.0.198;

    if ($http_x_forwarded_proto = '') {

        set $http_x_forwarded_proto  $scheme;

    }

    ## Application specific logs

    ## access_log /var/log/nginx/artifactory.net.nokia.com-access.log
timing;

    ## error_log /var/log/nginx/artifactory.net.nokia.com-error.log;

    rewrite ^/$ /artifactory/webapp/ redirect;

    rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;

    chunked_transfer_encoding on;

    client_max_body_size 0;

    location /artifactory/ {

    proxy_read_timeout  900;

    proxy_pass_header   Server;

    proxy_cookie_path   ~*^/.* /;

    proxy_pass          http://10.130.0.198:8081/artifactory/;

    proxy_set_header    X-Artifactory-Override-Base-Url
$http_x_forwarded_proto://$host:$server_port/artifactory;

    proxy_set_header    X-Forwarded-Port  $server_port;

    proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;

    proxy_set_header    Host              $http_host;

    proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;

    }

}



My artifactory application in deployed using docker in port 8081.



But when I do a docker login, nginx always returns 405 not found. But the
web UI works find with both the ip’s.



Is there anything wrong with my nginx configuration. Can someone help.



Thanks,

Syed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20171006/a996ce0a/attachment-0001.html>


More information about the nginx mailing list