
aws에서 사이트를 올바르게 표시하는 실행 중인 인스턴스가 있습니다. 사이트를 운영하기 위해 포함된 내용은 다음 django, nginx, uwsgi
과 같습니다.elastic ip
인스턴스의 이미지를 만들었습니다. 이제 첫 번째 인스턴스와 동일한 두 번째 인스턴스가 있는 인스턴스를 시작합니다.
두 번째 인스턴스에는 Normal 이 있습니다 floating ip
. 브라우저에 IP를 입력했을 때 아직 구성을 수행하지 않았기 때문에 내 사이트도 시간 초과될 때까지 오랜 로딩 시간이 걸릴 것으로 예상했습니다 site-available
.
어쨌든, 나는 환영 페이지만 볼 수 있었습니다 nginx
. 나는 에 가서 site-available
ip를 에 넣고 이름 server_name
도 설정했습니다 . 변경 후 uwsgi를 다시 시작했습니다.dns
subdomain
ip
브라우저에서 및를 사용해 보았지만 subdomain
여전히 nginx
환영 페이지가 표시됩니다. 심지어 오류도 없습니다.
누군가 내가 시도하는 이유나 조언을 알고 있습니까?
둘 다 동일한 설정인데 제대로 작동해야 하는 것 아닌가요?
추신: 그런 다음 첫 번째 인스턴스에서 두 번째 인스턴스로 이동하려고 했습니다 elastic ip
...브라우저에서 첫 번째 인스턴스의 도메인을 사용했습니다...그런 다음 내 사이트가 nginx
시작 페이지 가 아닌 팝업으로 나타납니다.
site-available
완벽하게 작동하는 원본 인스턴스의 경우
# `gzip` Settings
#
#
# gzip on;
# gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name xxx.xxx.xxx.xxx subdomain.domain.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 25M; # adjust to taste
# Django media
location /media {
alias /home/ubuntu/appName/appName/mediafiles; # your Django project's media files - amend as required
}
location /static {
alias /home/ubuntu/appName/appName/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass unix:/tmp/appName.sock;
include /home/ubuntu/appName/appName/uwsgi_params; # the uwsgi_params file you installed
#add_header 'Access-Control-Allow-Origin' '*';
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/subdomain.domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/subdomain.domain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
두 번째 경우는...을 변경 server_name
하고 포함 및 제외를 시도했지만 ssl
둘 다 동일한 결과입니다.
이것은 두 번째 인스턴스의 구성입니다.
# `gzip` Settings
#
#
# gzip on;
# gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name xx2.xx2.xx2.xx2 subdomain2.domain2.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 25M; # adjust to taste
# Django media
location /media {
alias /home/ubuntu/appName/appName/mediafiles; # your Django project's media files - amend as required
}
location /static {
alias /home/ubuntu/appName/appName/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass unix:/tmp/appName.sock;
include /home/ubuntu/appName/appName/uwsgi_params; # the uwsgi_params file you installed
#add_header 'Access-Control-Allow-Origin' '*';
}
#####################################
# TRIED INCLUDING AND EXCLUDING SLL
#####################################
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/subdomain2.domain2.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/subdomain2.domain2.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
#####################################
# TRIED INCLUDING AND EXCLUDING SLL
#####################################
}