Urgent proxy_pass
John Feuerstein
john at feurix.com
Wed Jun 8 18:21:23 MSD 2011
On 06/08/2011 04:14 PM, baurusites wrote:
> people please help me, I can not run Nginx
>
>
> root at servidor [~]# proxy_passRestarting nginx daemon: nginxnginx:
> [emerg] "proxy_pass" directive is not allowed here in
> /etc/nginx/nginx.conf:45
>
replace this:
proxy_temp_path /tmp/nginx_proxy/;
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
with this:
location / {
proxy_temp_path /tmp/nginx_proxy/;
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
proxy_pass is not allowed in http context, you need a location block.
See http://wiki.nginx.org/HttpProxyModule#proxy_pass
Hope this helps,
John
More information about the nginx
mailing list