/etc/nginx/conf.d/default.conf location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9000; }
/etc/nginx/nginx.confpython
user root;
uwsgi.inimysql
[uwsgi] socket = 127.0.0.1:9000 pythonpath=/path/flask_pro py-autoreload = 1 # 代碼修改自動重載 module=server callable=app master = true processes= 4 threads= 2 pidfile=uwsgi.pid daemonize=uwsgi.log
$ uwsgi --ini uwsgi.int $ uwsgi --reload uwsgi.pid
設置密碼登陸root:nginx
update user set authentication_string=PASSWORD('000000'), plugin='mysql_native_password' where user='root';
{ listen 80; server_name worktest.optima-trans.net; uwsgi_read_timeout 180; uwsgi_connect_timeout 180; uwsgi_send_timeout 180; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_ignore_client_abort on; location /v1/line { include uwsgi_params; uwsgi_pass unix:/var/www/optima_line/backend/current/tmp/uwsgi.sock; } location /socket.io { include uwsgi_params; uwsgi_pass unix:/var/www/service_message_1/backend/current/tmp/uwsgi.sock; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; #proxy_set_header Connection $connection_upgrade; } }
nginx配置文件詳解: https://blog.51cto.com/853056088/2128168sql