烏班圖16 配置nginx

阿里雲 烏班圖16

  1. 安裝ngnix
    sudo apt install nginxhtml

  2. nginx 啓動 重啓 關閉nginx

sudo service nginx start restart stop statusdjango

  1. nginx 的配置

sudo vim /etc/nginx/nginx.confvim

http {
        # upstream django {
          #  server 127.0.0.1:8001; # 使用8001端口與uWSGI服務器通訊
        # }
        server{
           listen       80;
           server_name hezhi.site;

          # location /ann {
               # uwsgi_pass  django;
               # include     /home/scripts/uwsgi_params; # the uwsgi_params file you installed
          # }
           location / {
               root /home/test;   # 靜態文件的目錄
               index index.html;  # 這裏切記不能丟掉分號
            }
        }
  }
相關文章
相關標籤/搜索