Nginx configuration with artifactory

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


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

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

So I have a load balancer configuration as below,

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

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

And externally

                Reaching to http port will be redirected to https port for

Now below is my nginx configuration file.

server {

    listen 80 ;


    if ($http_x_forwarded_proto = '') {

        set $http_x_forwarded_proto  $scheme;


    ## Application specific logs

    ## access_log /var/log/nginx/

    ## error_log /var/log/nginx/;

    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_set_header    X-Artifactory-Override-Base-Url

    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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list