我有我的免打扰设置为我的域名,我想加载一个Django网站的安装我已经安装。
当我加载www.mywebsite.com时,它加载了一个来自**/var/www/html的mydomain,但我希望它从/home/myname/kkappDashboard**加载;
我使用的是Nginx服务器,下面是站点可用配置
server {
listen 80;
server_name 151.236.222.57 www.mywebsite.com mywebsite.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myname/kkappDashboard;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/myname/kkappDashboard/kkappDashboard.sock;
}
}
server {
listen 443 ssl http2;
server_name www.mywebsite.com;
# redirect
return 301 https://mywebsite.com.com$request_uri;
}
server {
listen 443 ssl http2;
server_name mywebsite.com;
}
nginx.conf文件
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
listen 80;
server_name 151.236.222.xx;
return 301 $https://www.mywebsite.com$request_uri;
}
1条答案
按热度按时间yb3bgrhw1#
上述位置块将URI
//static/*
Map到文件/kkappDashboard/static/*
。如果您希望提供文件
/kkappDashboard/file.txt
(不带static/
),请考虑尝试: