使用nginx綁定域名訪問的示例:
1.打開nginx配置文件。
2.找到server_name的值修改為域名即可。
server {
listen 80;
server_name yisu.com; #域名
client_max_body_size 5M;
gzip on;
gzip_buffers 32 4K;#壓縮在內存中緩沖32塊 每塊4K
gzip_comp_level 6 ;#壓縮級別 推薦6
gzip_min_length 4000;#開始壓縮的最小長度4bit
gzip_types text/plain application/json application/javascript application/x-javascript application/css application/xml application/xml+rss text/javascript application/x-httpd-php image/jpeg image/gif image/png image/x-ms-bmp;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8000;
uwsgi_ignore_client_abort on;
}
location /static {
alias /root/make-money/static/;
}
}