# Question about using Upstream with proxy\_pass (because want to use /etc/hosts)

**URL:** <https://community.nginx.org/t/question-about-using-upstream-with-proxy-pass-because-want-to-use-etc-hosts/946>\
**Category:** NGINX\
**Tags:** upstream, hostnames, reverse-proxy\
**Created:** [March 4, 2025, 3:10pm UTC](https://community.nginx.org/t/question-about-using-upstream-with-proxy-pass-because-want-to-use-etc-hosts/946 "2025-03-04T15:10:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hanada](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/hanada/32/706_2.png) [@hanada](https://community.nginx.org/u/hanada)\
**Post date:** [March 9, 2025, 5:15pm UTC](https://community.nginx.org/t/question-about-using-upstream-with-proxy-pass-because-want-to-use-etc-hosts/946/2 "2025-03-09T17:15:25Z")

</div>

you must set upstream port to upstream block

```auto
   upstream localhosttomcat {
        server internaltomcat:34484;
   }

```

and change proxy\_pass  
`proxy_pass https://localhosttomcat$request_uri;`

---

_[View the full topic](https://community.nginx.org/t/question-about-using-upstream-with-proxy-pass-because-want-to-use-etc-hosts/946)._
