[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

WBOY
Release: 2016-08-18 09:15:37
Original
1697 people have browsed it

The reason is selinux problem. After closing it in /etc/selinux/config, restart it and it will be fine

  • I created a redmine, and my host can access 192.168.33.55:3000 through the browser

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • You can also access your own 192.168.33.55:3000 inside the virtual machine

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • So I started to modify nginx to forward 8080 to port 3000 of the virtual machine

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • But after nginx restarted, I accessed 8080 and received a 502 error

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • But if I forward 8080 to nginx’s default 80, it’s ok

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

This is something wrong with me. Why can’t I forward to port 3000? Help

Reply content:

The reason is selinux problem. After closing it in /etc/selinux/config, restart it and it will be fine

  • I created a redmine, and my host can access 192.168.33.55:3000 through the browser

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • You can also access your own 192.168.33.55:3000 inside the virtual machine

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • So I started to modify nginx to forward 8080 to port 3000 of the virtual machine

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • But after nginx restarted, I accessed 8080 and received a 502 error

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

  • But if I forward 8080 to nginx’s default 80, it’s ok

[Solved] Help centos6 nginx upstream cannot be forwarded to my own defined internal port

This is something wrong with me. Why can’t I forward to port 3000? Help

I guess that when you use curl to access: 3000, you use the root account, and when you use nginx to access: 3000, you may not use the root account. Judging from the log, when the tcp connection is permission denied, some online information says it is a problem with the SELinux configuration. You can check again according to this idea

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!