使用Tarantool http作为Nginx上游服务器-出现错误13:权限被拒绝

使用Tarantool http作为Nginx上游服务器-出现错误13:权限被拒绝,nginx,http-proxy,tarantool,tarantool-cartridge,Nginx,Http Proxy,Tarantool,Tarantool Cartridge,有Nginx吗 yum安装Nginx 有塔兰托+药筒吗 nginx.conf upstream tarantool_httpd { server 172.16.72.18:8082 max_fails=1 fail_timeout=15s; keepalive 32; } server { listen 80 default_server; listen [::]:80 default_server; serve

有Nginx吗 yum安装Nginx

有塔兰托+药筒吗

nginx.conf

upstream tarantool_httpd {
server 172.16.72.18:8082 max_fails=1 fail_timeout=15s;
keepalive 32;   
}

  server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;


        location / {
        }

    location = /redirections
    {
        proxy_pass http://tarantool_httpd;
    }
    location = /admin
    {
        proxy_pass http://tarantool_httpd;
    }


        error_page 404 /404.html;
        location = /404.html {
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        }
    }
当我请求URL时,access.log中出现错误502,Nginx error.log中出现错误

connect() to 172.16.72.18:8082 failed (13: Permission denied) while connecting to upstream, client: 172.16.72.32

看起来像是启用了SELinux

使用
sestatus检查它
并使用
sudo setexforce 0临时禁用它


如果问题将得到解决,您可以通过编辑
/etc/selinux/config
并将
selinux
设置为
disabled
将其永久禁用,它看起来像已启用的selinux

使用
sestatus检查它
并使用
sudo setexforce 0临时禁用它


如果问题得到解决,您可以通过编辑
/etc/selinux/config
并将
selinux
设置为
disabled
来永久禁用它,如果您不想完全禁用selinux(我不建议这样做,除非您确实需要这样做),使用此命令应足以允许nginx连接到后端:

sudo setsebool -P httpd_can_network_connect on

但是,您可能会遇到其他一些SELinux不兼容问题,因此,在遇到任何问题之前,检查sudo setenforce 0是否出现了一些奇怪的问题是非常有意义的。

如果您不想完全禁用SELinux(我不建议这样做,除非您确实需要这样做),使用此命令应足以允许nginx连接到后端:

sudo setsebool -P httpd_can_network_connect on

但是,您可能会遇到其他一些SELinux不兼容问题,因此在遇到任何问题之前,检查sudo setenforce 0是否出现了一些奇怪的问题是非常有意义的。

建议在这种情况下禁用SELinux看起来像是建议禁用防火墙,而不是向我打开特定端口。建议在这种情况下禁用SELinux看起来像是建议禁用防火墙,而不是向我打开一个特定的端口。