Non-bundled Nginx Web Server

Hi all,

I have set up a non-bundled Nginx web server, I also followed this section of the non-bundled Nginx manual:

When I enter my site it doesn’t conflict with the root domain (i.e no subdomain), however when I go on it keeps on returning a cloudflare 502. I have searched around on the forum and couldn’t find any posts that could help so I hope someone can help.

Nginx Config:

upstream gitlab-workhorse {
  server unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket fail_timeout=0;

server {
  listen [::]:80 ipv6only=on;
  server_tokens off;
  return 301 https://$http_host$request_uri;
  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;

server {
  listen ssl;
  listen [::]:443 ipv6only=on ssl;
  server_tokens off;
  root /opt/gitlab/embedded/service/gitlab-rails/public;

  ssl on;
  ssl_certificate /etc/ssl/certs/cert.pem;
  ssl_certificate_key /etc/ssl/private/key.pem;

  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 5m;

  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;

  location / {
    client_max_body_size 0;
    gzip off;

    proxy_read_timeout      300;
    proxy_connect_timeout   300;
    proxy_redirect          off;

    proxy_http_version 1.1;

    proxy_set_header    Host                $http_host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-Ssl     on;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto   $scheme;
    proxy_pass http://gitlab-workhorse;


I’m just guessing here, but…
Could it be a SElinux related thing?
Or maybe there’s something in nginx logs?