0

I install a shiny server and a nginx server on the same machine. I manage to access the home pages of nginx and shiny. I wish when I enter the address of the nginx server that has an authentication, redirects me to the page of shiny, I tried lots of instructions but none of them works, they send me back to the page d nginx error

nginx error! The page you are looking for is temporarily unavailable. Please try again later

Except the directive rewrite that skips the authentication.

/etc/nginx/nginx.conf

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}
http {
    #map $http_upgrade $connection_upgrade {
    #  default upgrade;
    #  ''      close;
    #}
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    include /etc/nginx/conf.d/*.conf;
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  httppasword_serv;

        root         /usr/share/nginx/html;
        auth_basic "Private Property";
        auth_basic_user_file /etc/nginx/.htpasswd;

        #rewrite ^ http://adress-IP-server:3838 permanent;

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

          proxy_pass http://127.0.0.1:3838;
          #proxy_redirect http://127.0.0.1:3838/ $scheme://$host/;
        }
        #upstream my_port {
         # server 127.0.0.1:3838;
        #}
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

/var/log/nginx/error.log

2018/01/24 17:44:45 [crit] 1701#0: *1 connect() to adress-ip-server:3838 failed (13: Permission denied) while connecting to
 upstream, client: adress-ip-client, server: httppasword_serv, request: "GET /nginx-logo.png HTTP/1.1", upstream: "http://adress-ip
server:3838/nginx-logo.png", host: "adress-ip-server", referrer: "http://adress-ip-server/"

sudo cat /var/log/audit/audit.log | grep nginx | grep denied

type=AVC msg=audit(1516359636.202:668): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516359636.203:669): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516359657.422:670): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516359657.422:671): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360479.153:798): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360479.153:799): avc:  denied  { name_connect } for  pid=5751 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360517.474:807): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360517.474:808): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360531.522:809): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360531.522:810): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360542.292:811): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360542.292:812): avc:  denied  { name_connect } for  pid=6035 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360732.283:835): avc:  denied  { name_connect } for  pid=6086 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516360732.283:836): avc:  denied  { name_connect } for  pid=6086 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361082.068:884): avc:  denied  { name_connect } for  pid=6156 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361082.068:885): avc:  denied  { name_connect } for  pid=6156 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361212.476:909): avc:  denied  { name_connect } for  pid=6195 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361212.476:910): avc:  denied  { name_connect } for  pid=6195 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361315.831:942): avc:  denied  { name_connect } for  pid=6250 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516361315.831:943): avc:  denied  { name_connect } for  pid=6250 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516604013.934:328): avc:  denied  { name_connect } for  pid=1695 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516604013.934:329): avc:  denied  { name_connect } for  pid=1695 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516687693.897:156): avc:  denied  { name_connect } for  pid=819 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516687693.907:157): avc:  denied  { name_connect } for  pid=819 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516688431.742:163): avc:  denied  { name_connect } for  pid=819 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516688431.742:164): avc:  denied  { name_connect } for  pid=819 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516689466.033:189): avc:  denied  { name_connect } for  pid=1299 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516689466.033:190): avc:  denied  { name_connect } for  pid=1299 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516689495.175:191): avc:  denied  { name_connect } for  pid=1299 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516689495.175:192): avc:  denied  { name_connect } for  pid=1299 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516690418.202:306): avc:  denied  { name_connect } for  pid=1545 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516691042.413:464): avc:  denied  { name_connect } for  pid=1545 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516691325.998:515): avc:  denied  { name_connect } for  pid=1924 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516693591.433:696): avc:  denied  { name_connect } for  pid=1924 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695500.311:782): avc:  denied  { name_connect } for  pid=2849 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695500.690:783): avc:  denied  { name_connect } for  pid=2849 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695501.003:784): avc:  denied  { name_connect } for  pid=2849 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695532.817:793): avc:  denied  { name_connect } for  pid=2849 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695640.154:810): avc:  denied  { name_connect } for  pid=2953 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695655.034:811): avc:  denied  { name_connect } for  pid=2953 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516695710.950:826): avc:  denied  { name_connect } for  pid=2998 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516704173.689:1085): avc:  denied  { name_connect } for  pid=5766 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516704222.417:1099): avc:  denied  { name_connect } for  pid=5852 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516704230.884:1100): avc:  denied  { name_connect } for  pid=5852 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516705110.582:1118): avc:  denied  { name_connect } for  pid=5852 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516705441.205:1153): avc:  denied  { name_connect } for  pid=6138 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516705443.089:1154): avc:  denied  { name_connect } for  pid=6138 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516705491.804:1167): avc:  denied  { name_connect } for  pid=6166 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791100.299:659): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791100.682:660): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791100.683:661): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791170.420:679): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791170.854:680): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516791170.867:681): avc:  denied  { name_connect } for  pid=3772 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793228.386:1252): avc:  denied  { name_connect } for  pid=4571 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793228.764:1253): avc:  denied  { name_connect } for  pid=4571 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793228.768:1254): avc:  denied  { name_connect } for  pid=4571 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793547.069:1278): avc:  denied  { name_connect } for  pid=4649 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793547.831:1279): avc:  denied  { name_connect } for  pid=4649 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793547.834:1280): avc:  denied  { name_connect } for  pid=4649 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793748.464:1301): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793748.844:1302): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516793748.845:1303): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794191.144:1346): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794191.516:1347): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794191.519:1348): avc:  denied  { name_connect } for  pid=4753 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794282.743:1361): avc:  denied  { name_connect } for  pid=4902 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794283.123:1362): avc:  denied  { name_connect } for  pid=4902 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794283.134:1363): avc:  denied  { name_connect } for  pid=4902 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794904.922:1386): avc:  denied  { name_connect } for  pid=4963 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516794904.922:1387): avc:  denied  { name_connect } for  pid=4963 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516795269.506:1416): avc:  denied  { name_connect } for  pid=5092 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516795269.507:1417): avc:  denied  { name_connect } for  pid=5092 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516796959.665:1665): avc:  denied  { name_connect } for  pid=5497 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516796959.666:1666): avc:  denied  { name_connect } for  pid=5497 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516814311.031:240): avc:  denied  { name_connect } for  pid=1507 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516814311.531:241): avc:  denied  { name_connect } for  pid=1507 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516814311.532:242): avc:  denied  { name_connect } for  pid=1507 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516814311.907:243): avc:  denied  { name_connect } for  pid=1507 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516814312.212:244): avc:  denied  { name_connect } for  pid=1507 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516815884.742:283): avc:  denied  { name_connect } for  pid=1701 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516815885.224:284): avc:  denied  { name_connect } for  pid=1701 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1516815885.227:285): avc:  denied  { name_connect } for  pid=1701 comm="nginx" dest=3838 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket

port 3000 is used by the nodejs auth0 application

nginx -t

2018/01/24 20:16:44 [warn] 2267#0: the "user" directive makes sense only if the master process runs with super-user privileges, igno
red in /etc/nginx/nginx.conf:5
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2018/01/24 20:16:44 [emerg] 2267#0: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed
problème0123
  • 841
  • 2
  • 9
  • 23

1 Answers1

0

You have either SELinux or AppArmor enabled and configured it to deny nginx to open outgoing connections to your backend (this might be the default for your unix distribution).

Check the log to see why:

cat /var/log/audit/audit.log | grep nginx | grep denied

A resolution would be to allow nginx network access (only works for distributions with SELinux):

setsebool -P httpd_can_network_connect 1

For more information see: (13: Permission denied) while connecting to upstream:[nginx]

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38
  • Hello, thank you that solved my problem, but after typing these commands i have always **denied** in file **audit.log** and when i do **nginx -t** i have a message, I edited my first post to show you the results. – problème0123 Jan 24 '18 at 20:27
  • "i have always denied" that is what you were filtering for. – rollstuhlfahrer Jan 24 '18 at 20:32