# NGINX: Set/use requests with fully qualified domain name (= FQDN)

**URL:** <https://www.ruby-forum.com/t/nginx-set-use-requests-with-fully-qualified-domain-name-fqdn/244603>\
**Category:** NGINX\
**Created:** [May 11, 2016, 1:24pm UTC](https://www.ruby-forum.com/t/nginx-set-use-requests-with-fully-qualified-domain-name-fqdn/244603 "2016-05-11T13:24:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 11, 2016, 1:24pm UTC](https://www.ruby-forum.com/t/nginx-set-use-requests-with-fully-qualified-domain-name-fqdn/244603/1 "2016-05-11T13:24:46Z")

</div>

Hi @ all. NGINX proxy\_pass works great with our internal servers. Thanks  
for  
the good work.

Now I want to proxy\_pass an external server and I have to use our proxy  
for  
this to get an external connection.

I checked with tcpdump and Wireshark. NGINX sends

“GET /uri HTTP/1.1  
HOST: [external.com](http://external.com)”

to my upstream (= coporate proxy).

Can I modify this to

“GET [external.com is for sale](http://external.com:80/uri) HTTP/1.1  
HOST: [external.com](http://external.com)”

?

Problem is: Our proxy denies requests (error 400 bad request) without  
FQDN  
(= fully qualified domain name).

Any help or workaround is welcome.

Posted at Nginx Forum:

> **[NGINX: Set/use requests with fully qualified domain name (= FQDN).](https://forum.nginx.org/read.php?2,266802,266802#msg-266802)**
>
> Hi @ all. NGINX proxy\_pass works great with our internal servers. Thanks for the good work. Now I want to proxy\_pass an external server and I have to use our proxy for this to get an external connection. I checked with tcpdump and Wireshark. NGINX...

---

<div class="post-metadata">

**Author:** ![Sportmodus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4af34b/32.png) [@Sportmodus](https://www.ruby-forum.com/u/Sportmodus)\
**Post date:** [May 12, 2016, 12:29am UTC](https://www.ruby-forum.com/t/nginx-set-use-requests-with-fully-qualified-domain-name-fqdn/244603/2 "2016-05-12T00:29:00Z")

</div>

On Wed, May 11, 2016 at 07:24:09AM -0400, Sportmodus wrote:

Hi there,

> Now I want to proxy\_pass an external server and I have to use our proxy for  
> this to get an external connection.

Stock nginx does not speak proxy-http to a proxy server.

> Can I modify this to
> 
> “GET [External.com](http://external.com:80/uri) HTTP/1.1  
> HOST: [external.com](http://external.com)”
> 
> ?

Only if you arrange for the code to do it be written.

If you choose to write it fully, it might be welcomed into stock nginx.

> Problem is: Our proxy denies requests (error 400 bad request) without FQDN  
> (= fully qualified domain name).

Your proxy is correct to do so.

It just expects a protocol that nginx does not speak.

> Any help or workaround is welcome.

Use something that can be a proxy client, and use it instead of (or as  
well as) nginx.

Or, since nginx is a reverse proxy, and you only reverse proxy for  
things  
you control, change your policy so that nginx can talk to your external  
web server without going through the proxy.

I don’t think that there is a “good” answer.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Sportmodus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4af34b/32.png) [@Sportmodus](https://www.ruby-forum.com/u/Sportmodus)\
**Post date:** [May 13, 2016, 10:30am UTC](https://www.ruby-forum.com/t/nginx-set-use-requests-with-fully-qualified-domain-name-fqdn/244603/3 "2016-05-13T10:30:38Z")

</div>

Thanks.

I used Apache (behind NGINX) with

ProxyRemote \* [http://proxy:8080](http://proxy:8080)

in conjunction with ProxyPass. Works!

Posted at Nginx Forum:

> **[Re: NGINX: Set/use requests with fully qualified domain name (= FQDN).](https://forum.nginx.org/read.php?2,266802,266883#msg-266883)**
>
> Hi @ all. NGINX proxy\_pass works great with our internal servers. Thanks for the good work. Now I want to proxy\_pass an external server and I have to use our proxy for this to get an external connection. I checked with tcpdump and Wireshark. NGINX...
