Awasu » Running Nexus behind an nginx reverse proxy
Tuesday 9th August 2022 10:58 AM

Configuring nginx to sit in front of Nexus as a reverse proxy is straight-forward. The only thing that was needed was to set the Host header:

server {
    server_name nexus3 ;
    listen 80 ;
    location / {
        proxy_pass http://127.0.0.1:8081 ;
        proxy_send_timeout 120 ;
        proxy_read_timeout 300 ;
        proxy_buffering off ;
        proxy_set_header Host $host ;
        client_max_body_size 1G ;
    }
}

If you're proxying for Docker Hub, you can also add an entry for that as well e.g.

server {
    server_name nexus3-dockerhub ;
    listen 80 ;
    location / {
        proxy_pass http://127.0.0.1:8082 ;
        proxy_send_timeout 120 ;
        proxy_read_timeout 300 ;
        proxy_buffering off ;
        proxy_set_header Host $host ;
    }
}

Have your say