https://prefect.io logo
#prefect-community
Title
# prefect-community
c

CA Lee

06/15/2022, 11:48 PM
Hello, does anyone have any experience setting up Prefect Orion to be accessed via a web URL (HTTPs)?
Here is my nginx config:
Copy code
server {

    listen 80;
    server_name <http://example.com|example.com> <http://www.example.com|www.example.com>;

    if ($host = <http://www.example.com|www.example.com>) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = <http://example.com|example.com>) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
}

server {
    listen 443 ssl http2; # managed by Certbot
    server_name <http://www.example.com|www.example.com>;

    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
}

server {
    listen 443 ssl http2; # managed by Certbot
    server_name <http://example.com|example.com>;

    location / {
        proxy_pass <http://127.0.0.1:4200>;
        proxy_set_header   Host      $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_buffering    off;
        proxy_http_version 1.1;

        # Also requires websocket:
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
    }

    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
}
I am getting this error:
No supported WebSocket library detected. Please use 'pip install uvicorn[standard]', or install 'websockets' or 'wsproto' manually.
If I forward port 4200 in VS Code, I can access the server running normally on http://localhost:4200
But I cant access via https://my-url.com
I have tried installing all the recommended libraries uvicorn, websockets, wsproto, in both my Python venv and on system Python, and restarted the service, but still running into same error
Disabling this block in nginx allows me to access Orion server, but with no flow data:
Copy code
# Also requires websocket:
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
k

Kevin Kho

06/16/2022, 2:52 AM
You can do this . I don’t think you need to do the nginx yourself?
And then point your DNS to the public IP of VM? Just HTTP though
30 Views