<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Arial Black";
panose-1:2 11 10 4 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Hi everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">I’m trying to get nginx to work as a load balancer for 2 squid forward proxies. I’m running nginx 1.6.2 on a Centos 7 64bit machine. Here’s my config:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Nginx.conf:<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">user nginx;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">worker_processes 1;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">error_log /var/log/nginx/error.log warn;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">pid /var/run/nginx.pid;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">events {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> worker_connections 1024;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">http {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> upstream HD {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> server xxx.xxx.xxx.xxx:8080;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> server xxx.xxx.xxx.xxx:8080 backup;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> include /etc/nginx/mime.types;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> default_type application/octet-stream;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> log_format main '$remote_addr - $remote_user [$time_local] "$request" '<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> '$status $body_bytes_sent "$http_referer" '<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> '"$http_user_agent" "$http_x_forwarded_for"';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> access_log /var/log/nginx/access.log main;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> sendfile on;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> #tcp_nopush on;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> keepalive_timeout 65;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> #gzip on;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> include /etc/nginx/conf.d/*.conf;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">My conf.d/default.conf<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">server {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> listen 8080;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> server_name localname.localdomain.de;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> #charset koi8-r;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> #access_log /var/log/nginx/log/host.access.log main;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> location / {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> proxy_pass http://HD;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial Black","sans-serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">I’m using my nginx in the proxy settings of my internet explorer and try to visit e.g.
<a href="http://www.google.de">www.google.de</a> . The request gets forwarded to the first of my server (as the second is only backup), but the requested URL get exchanged to „ / “ . So my question is:
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Is there a way to pass the requested URL, nginx is receiving, forward to my two squid servers ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">I’m new to nginx, but i already googled and used the wiki, but I didnt find anything useful
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Thanks in advance!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Alex<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>