# Nginx (proxy pass) + Nexus 3 (docker)

**URL:** https://community.sonatype.com/t/nginx-proxy-pass-nexus-3-docker/6612
**Category:** Sonatype Nexus Repository
**Tags:** nexus-repository
**Created:** [May 26, 2021, 3:24pm UTC](https://community.sonatype.com/t/nginx-proxy-pass-nexus-3-docker/6612 "2021-05-26T15:24:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![serogava](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@serogava](https://community.sonatype.com/u/serogava)
#### Post date: [May 26, 2021, 3:24pm UTC](https://community.sonatype.com/t/nginx-proxy-pass-nexus-3-docker/6612/1 "2021-05-26T15:24:41Z")

</div>

Hello.  
I try next configuration:  
I started nexus 3 in the docker container and install nginx service.  
My configuration nginx:

server {  
listen 443 ssl;  
server\_name [registry.it-lessons.ru](http://registry.it-lessons.ru);

```
ssl on;
ssl_certificate "/etc/ssl/certs/nginx-selfsigned.crt";
ssl_certificate_key "/etc/ssl/private/nginx-selfsigned.key";

location ~ (/v1/|/v2/) {
    proxy_set_header Host $host:$server_port;
    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";
    proxy_pass http://localhost:8081/repository/test1;

    location / {
    proxy_set_header Host $host:$server_port;
    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";
    proxy_pass http://localhost:8081;
    }

```

}

I saw configuration there:  
[https://support.sonatype.com/hc/en-us/articles/360000761828-Docker-Repository-Reverse-Proxy-Strategies?\_ga=2.92572062.264202319.1622029018-318122752.1621255951](https://support.sonatype.com/hc/en-us/articles/360000761828-Docker-Repository-Reverse-Proxy-Strategies?_ga=2.92572062.264202319.1622029018-318122752.1621255951)

But I see nginx configuration error:  
[root@registry ~]# nginx -t  
nginx: [emerg] “proxy\_pass” cannot have URI part in location given by regular expression, or inside named location, or i  
nside “if” statement, or inside “limit\_except” block in /etc/nginx/conf.d/registry.conf:14  
nginx: configuration file /etc/nginx/nginx.conf test failed

What can I change this?

---

<div class="post-metadata">

### Author: ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)
#### Post date: [May 26, 2021, 7:01pm UTC](https://community.sonatype.com/t/nginx-proxy-pass-nexus-3-docker/6612/2 "2021-05-26T19:01:57Z")

</div>

Hi Serogava,  
It seems like your configuration file is missing a closing curly brace after on line before `location / {`.

---

<div class="post-metadata">

### Author: ![serogava](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@serogava](https://community.sonatype.com/u/serogava)
#### Post date: [May 26, 2021, 7:33pm UTC](https://community.sonatype.com/t/nginx-proxy-pass-nexus-3-docker/6612/3 "2021-05-26T19:33:23Z")

</div>

Thanks you, but it not helped me.
