parse server error Unable to connect to server through domain name

54 Views Asked by At

Hi guys hope you doing well I'm working on setting up Parse Dashboard for my application, and I want to use a custom domain name with Cloudflare's Full Strict SSL for enhanced security. however I got

Server not reachable: unable to connect to server

through domain name consider if I change - PARSE_SERVER_URL and - PARSE_DASHBOARD_SERVER_URL values to ip address everything works fine through ip address and this issue only persist with domain name

this is my docker-compose.yml :

version: '3'
services:

    mongo:
        image: mongo
        ports:
            - 27017:27017
        volumes:
            - ./data-db:/data/db

    parse:
        image: parseplatform/parse-server
        ports:
            - 1337:1337
        links:
            - mongo
        environment:
            - PARSE_SERVER_APPLICATION_ID=xxxxxxxxxxxxxxx
            - PARSE_SERVER_MASTER_KEY=xxxxxxxxxxxxxxx
            - PARSE_SERVER_DATABASE_URI=mongodb://mongo:27017/dev
            - PARSE_SERVER_START_LIVE_QUERY_SERVER=1
            - PARSE_SERVER_LIVE_QUERY={"classNames":["people","monitor"]}
            - PARSE_SERVER_MASTER_KEY_IPS=0.0.0.0/0
            - PARSE_SERVER_URL=https://example.com
            - PARSE_SERVER_MOUNT_PATH=/parse
          

    dashboard:
        image: parseplatform/parse-dashboard
        ports:
            - 4040:4040
        depends_on:
            - parse
        environment:
            - PARSE_DASHBOARD_SERVER_URL=https://example.com
            - PARSE_DASHBOARD_APP_ID=xxxxxxxxxxxxxxx
            - PARSE_DASHBOARD_MASTER_KEY=xxxxxxxxxxxxxxx
            - PARSE_DASHBOARD_APP_NAME=MyApp
            - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=0
            - PARSE_DASHBOARD_USER_ID=admin
            - PARSE_DASHBOARD_USER_PASSWORD=admin
            

and this is my nginx config file :

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com www.example.com;

    ssl_certificate /etc/nginx/ssl/example.com.pem;
    ssl_certificate_key /etc/nginx/ssl/example.com.key;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://localhost:1337/parse;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

server {
    listen 443 ssl;
    server_name dash.example.com

    ssl_certificate /etc/nginx/ssl/example.com.pem;
    ssl_certificate_key /etc/nginx/ssl/example.com.key;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://localhost:4040;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        
    }
}

0

There are 0 best solutions below