[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Does anyone here use nginx as a reverse proxy? I want to bu
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 7
Thread images: 1
File: NGINX.jpg (9 KB, 400x320) Image search: [Google]
NGINX.jpg
9 KB, 400x320
Does anyone here use nginx as a reverse proxy?

I want to build a setup where I have one address that reverse proxies multiple internal sites for external access, but I can't get it to work internally yet. As of now, I can access one internal site without any problems, works completely fine, even with https outside and http inside. When I add further sites however, I either get sites that are barely functional or simply get a 404 error.

The setup in the configuration file is essentially

server {
listen 443
location /webservera {
proxy_pass http://webservera.example.com/;
}
location /webserverb {
proxy_pass http://webserverb.example.com/;
}
}

Webserver A works fine, Webserver B gets me a 404 error. When I look in the error log I see that nginx is trying to access webserverb locally (i.e. normally you get redirecty to webserverb/index.php, but it will look for index.php on the nginx machine, not on webserverb).
Why is this only happening on webserverb (and for that matter, c, d and e as well)? What can I do to ensure the path to the site content is proxied as well and doesn't try to access stuff locally?
>>
Bump with additional info
>I've already tried adding ^~ in front of location
>it happens both with /webserverb and /webserverb/ as location
>the error is simply that the requested file is not found at /user/share

Really confused about this.
>>
>>>/Stackexchange/
>>
>>53696047
Try removing the "/" at the end of your proxy_pass line, just before the ;
>>
>>53696047
>>53696775
also, if http://webserverb.example.com/ is pointing on the same server as your nginx, it's totally possible for it to take you to a local 404
>>
>>53696047
use ip address, so it doesn't have to lookup all the time
>>
>>53696775
Removing the / at the end makes it forward the full URL. A request for https://example.org/webservera/resource would be sent to http://webservera.example.com/webservera/resource. With the / it becomes http://webservera.example.com/resource
Thread replies: 7
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.