Welcome! Log In Create A New Profile

Advanced

NGINX-flask-bokeh-digitalocean

Posted by seramex 
NGINX-flask-bokeh-digitalocean
April 30, 2021 03:19PM
I am attempting to make a website in flask that embeds an interactive bokeh server app. The site works fine on my desktop, but I can't get it to work on the actual site over tens of hours in the last several weeks. I have been very determined to get it figured out and am now asking for assistance. I have been learning python for about 18 months and this is my first shot at a web app.

I am using NGINX with gunicorn on DigitalOcean running ubuntu 20.04. The python libraries are flask and bokeh. Everything runs in a virtual environment. I run it from root.

With no web experience, I've used a udemy course (Interactive Data Visualization with Python and Bokeh | Udemy, from 2016) and many tutorials/articles to get this far. This stack overflow (python - Reverse-proxying: Flask app with Bokeh server on Nginx - Stack Overflow, from 2017) has been the closest to what I need and I have in fact used a combination of the udemy course and this post to generate the needed files. The stack overflow response made use of this forum and a bokeh google group for assistance, and solution.

Here is the error:
2021/04/30 19:04:36 [emerg] 312076#312076: unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/flask.conf:7

If I comment out the "include" line where the config files are located (sites-enabled directory) then I get this error:

2021/04/30 18:59:46 [emerg] 311945#311945: SSL_CTX_set_cipher_list("###") failed (SSL: error:140E6118:SSL routines:ssl_cipher_process_rulestr:invalid command)

I can use the old nginx.conf file and get the site to come up without the embedded content. I can run the bokeh server on my desktop and it will embed on the live site. Looks like a configuration problem, or I simply don't know how to use these files properly. I'm pretty well willing to do whatever is needed, starting over if it makes things easier.

File locations:
/etc/nginx/nginx.conf
/etc/nginx/conf.d/flask.conf
/etc/nginx/conf.d/mybokeh-app.conf
/etc/nginx/sites-available/default
/etc/nginx/sites-available/mysite (file also in /etc/nginx/sites-enabled/ )
/usr/lib/systemd/system/nginx.service


I can only attach 3 files but I thought the nginx.conf was relevant:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

#include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}


If there's more info anyone wants, please let me know.
Appreciate any help, insight, direction.

Scott
Attachments:
open | download - flask.conf (183 bytes)
open | download - mybokeh-app.conf (360 bytes)
open | download - default (2.1 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 324
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready