amazon-web-services - AWS EC2 S3 冲突
问题描述
嗨,我在创建一个托管 AngularJs 应用程序的 EC2 实例时遇到了很大的麻烦,为了缩短它,我有一个具有弹性 ip 和域名的 EC2 实例http://dev.mydomain.net
(机器安装了 Nginx)我的工作区由 Jenkins 复制到名为S3.dev.mydomain.net
backed的 S3 存储桶通过 CDN 分发,我的目标是创建一个新域名(dev2.mydomain.net)
,所以我从第一个实例创建了一个图像以及另一个 S3 存储桶,它是 CDN,问题是每当我尝试使用从外部访问 Angular 应用程序时,http://dev2.mydomain.net
我都会被重定向到 Nginx欢迎页面!每当我尝试使用新创建的实例公共 dns 访问应用程序时,我都会被证书捕获NET::ERR_CERT_COMMON_NAME_INVALID
假设新创建的实例具有与原始实例相同的安全配置文件,我还浏览了所有 AWS 服务,以了解实际如何http:dev.mydomain.net
链接到原始实例的弹性 ip,但我不明白,不知道我错过了什么
更新:原始实例的 Nginx conf:
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 133916;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include conf.d/*.conf;
map $http_upgrade $connection_upgrade {
default "upgrade";
}
server {
listen 80 default_server;
access_log /var/log/nginx/access.log main;
client_header_timeout 60;
client_body_timeout 60;
keepalive_timeout 60;
gzip off;
gzip_comp_level 4;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/*.conf;
}
}
解决方案
推荐阅读
- angularjs - 在主干和 Angularjs 的情况下,Highcharts 默认比例间隔不同
- javascript - flexbox list column-reverse 并从顶部开始
- nginx - 使用 nginx 入口控制器为金丝雀版本启用会话亲和性
- reactjs - 除了我不想在 redux-persist 中清除的内容之外,如何清除所有内容?
- scala - 任务不可序列化:java.io.NotSerializableException:org.apache.spark.unsafe.types.UTF8String$IntWrapper
- java - Tomcat 在不同机器上部署时找不到 servlet 和 JSP 文件
- ruby - 字符串包括来自数组的子字符串
- c++ - 缩小 C++ 概念以排除某些类型
- java - Java SAX 解析器为有效 URL 抛出 403 异常
- r - r:使用 `for` 和 `if` 仅在数字变量上运行运行函数