0
我想在同一个django应用和同一个nginx服务器上运行多个网站。 我成功运行http:// myip /和http:// myip/name1和http:// myid/name2Nginx多个域名一个应用和服务器
现在我想将所有这些项目链接到myname.com和name1.com和name2。 com
我该如何更改我的nginx配置文件?该文件的当前版本如下所示。感谢
upstream crsq {
server localhost:8000;
}
server {
listen 80 default;
access_log /home/ubuntu/crsq-access.log;
error_log /home/ubuntu/crsq-error.log error;
# Make site accessible from http://localhost/
server_name crsq;
location @proxy_to_crsq_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http: //crsq;
}
location /robots.txt {
alias /home/ubuntu/crsq/crsq/robots.txt;
}
location/{
try_files $uri @proxy_to_crsq_app;
}
location /static {
alias /home/ubuntu/crsq/crsq/static;
}
}
proxy_pass HTTP://本地主机:3000/URI /; – himangshuj