0

I'm trying to run nexus behind an SSL Reverse Proxy, where nexus is not working with custom context path.

I've also updated with Base URL Capabilities in nexus as https://dev

location / {    
    .....
    .....
    } 
 

With location / the request works properly, however it does not work with location /nexus

Below is my nginx config for reference


  server {
    listen   *:443;
    server_name  dev;
  
    client_max_body_size 1G;
    proxy_max_temp_file_size 2G;
  
    ssl on;
    ssl_certificate      dev-test.crt;
    ssl_certificate_key  dev-test.key;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5s;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;  
  
    location /nexus {   
        proxy_pass http://server:8081/;
        proxy_set_header 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 "https";
    }
  }
Shoaib
  • 1
  • 2

1 Answers1

0

You need to change the native context path of Nexus Repo to match the context path in the reverse proxy.

Edit $datadir/etc/nexus.properties and set:

nexus-context-path=/nexus

Or if running in a container, add this to the INSTALL4J_ADD_VM_PARAMS environment variable passed into the instance:

-Dnexus-context-path=/nexus
rseddon
  • 5,082
  • 15
  • 11