amazon-web-services - 在 beantalk 部署期间 Nginx 配置覆盖

标签 amazon-web-services nginx amazon-elastic-beanstalk

我尝试使用更改 nginx 配置

尝试 1

.ebextensions/000_nginx.config

container_commands:
  01_reload_nginx:
    command: "sudo echo 'underscores_in_headers on;' >> /etc/nginx/conf.d/elasticbeanstalk/00_application.conf"



尝试 2

.ebextensions/000_nginx.config
files:
  "/tmp/proxy.conf":
    mode: "000644"
    owner: root
    group: root
    content: |

      underscores_in_headers on;
container_commands:
  00-add-config:
    command: cat /tmp/proxy.conf >> /etc/nginx/conf.d/elasticbeanstalk/00_application.conf
  01-restart-nginx:
    command: /sbin/service nginx restart



尝试 3

.ebextensions/nginx/conf.d/elasticbeanstalk/00_application.conf
location / {
    proxy_pass          http://127.0.0.1:5000;
    proxy_http_version  1.1;

    proxy_set_header    Connection          $connection_upgrade;
    proxy_set_header    Upgrade             $http_upgrade;
    proxy_set_header    Host                $host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
}

underscores_in_headers on;

但是每次尝试更新文件,然后在代码部署到 Beanstalk 后清除更改

如何防止覆盖配置文件或基本上如何更改 Nginx 配置?

最佳答案

我以前有过类似的问题。这可能是因为您正在压缩和上传整个项目文件夹,而不仅仅是项目文件夹内容

关于amazon-web-services - 在 beantalk 部署期间 Nginx 配置覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52275673/

相关文章:

amazon-web-services - 如何让 AWS EC2 不重置我的 sshd_config 文件?

amazon-web-services - 亚马逊 EMR 中 Hue 中存储的文件在哪里

nginx - 带有nginx的Docker注册表:没有这样的主机

nginx - 带有粘性 session 的 docker-compose 规模

amazon-web-services - 如何在cloudformation中为我的beanstalk定义nodejs的版本

amazon-web-services - 在 AWS API Gateway 中,如何将 HTTPS 密码限制为提供完美前向保密的密码?

amazon-web-services - 堆栈构建超时构建 ECS 服务

django - gunicorn + nginx : Server via socket or proxy?

java - 将 Java Web 应用程序部署到 Amazon Elastic Beanstalk

node.js - AWS beanstalk Nodejs 多核