1.安装 Nginx
yum install -y nginx
2. 修改nginx配置文件
cd /etc/nginx/mv nginx.conf nginx.conf.swfmv nginx.conf.default nginx.confvi nginx.conf
upstream tornados{ server 127.0.0.1:8888; } proxy_next_upstream error; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { #root html; #index index.html index.htm; proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://tornados; }
3.启动tornado
/root/anaconda3/envs/demo/bin/python /root/python_codes/tornadodemo/main.py
4.启动Nginx
systemctl start nginx.servicesystemctl stop nginx.servicesystemctl restart nginx.servicesystemctl enable nginx.service
5.访问网址
http://190.39.90.3/test
enjoy :)...