Proxy_pass with runtime variables?

Quan Zhou quanzhou822 at gmail.com
Fri Apr 2 17:35:16 MSD 2010


Thank you for your reply, igor.
I've corrected server name field with a '_' (and tried $host
$http_host later), and both $server_name and $host can pass the
grammar check, it doesn't work finally, actually, it returns a cacti
page on my server for any request, I've checked entire configuration
files, cacti is only assigned to a domain name but bind to [::]:80,
however, I don't think this caused cacti has highier priority ...
:confused

Quan Zhou
Sent from my Windows(R) phone.

On Fri, Apr 2, 2010 at 4:03 PM, Igor Sysoev <igor at sysoev.ru> wrote:

> On Fri, Apr 02, 2010 at 12:00:01PM +0800, Quan Zhou wrote:
>
> > Hi all,
> >
> > I'm having issues with reverse proxy on Nginx
> >
> > I was setting up a reverse proxy listening [::0]:80 acts as 6 to 4 server
> on
> > Nginx, so I've tried $host, $server_name, $http_host in proxy_pass field,
> > but they all failed, and server threw same error:
> >
> >
> >  [emerg]: invalid number of arguments in "proxy_pass" directive in
> > /etc/nginx/sites-enabled/reverse.proxy:16
> >
> >
> > Here's my configuration file:
> >
> > server {
> >         listen   [::0]:80;
> >         server_name  *.*;
>
> "*.*" is invalid server_name.
>
> >         access_log  off;
> >         error_log off;
> >
> >         location /{
> >                 proxy_pass $server_name
>
> -                 proxy_pass $server_name
> +                 proxy_pass $server_name;
>
> or probably
>
> -                 proxy_pass $server_name
> +                 proxy_pass $host;
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



-- 
Individuals who have received this information in error or are not
authorized to receive it must promptly return or dispose of the information
and notify the sender. Those individuals are hereby notified that they are
strictly prohibited from reviewing, forwarding, printing, copying,
distributing or using this information in any way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100402/096dea46/attachment.html>


More information about the nginx mailing list