NutzCN Logo
问答 Nginx 代理多域名配置报错
发布于 460天前 作者 Wizzercn 587 次浏览 复制 上一个帖子 下一个帖子
标签: nginx

http://test.wizzer.cn/ --> http://test.wizzer.cn:8101/

配置文件:
server {
listen 80;
server_name test.wizzer.cn;
location / {
proxy_pass http://test.wizzer.cn:8101;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

报错:
2015/12/19 18:02:03 [crit] 9978#0: *8 connect() to 61.132.139.155:8101 failed (13: Permission denied) while connecting to upstream, client: 124.73.13.21, server: test.wizzer.cn, request: "GET / HTTP/1.1", upstream: "http://61.132.139.155:8101/", host: "test.wizzer.cn"

求大神~~~~~~~~

3 回复

用 up_stream反向代理的配置

upstream wizzer_test {
	server 61.132.139.155:8101 max_fails=0;
}

proxy_pass http://wizzer_test;

敲两行命令,设置selinux权限即可。。。。

setenforce 0
setsebool -P httpd_can_network_connect 1

添加回复
请先登陆
回到顶部