Nginx代理管理器与Magento 2和Docker Compose



我正试图让Magento 2在Portainer和Nginx Proxy Manager的docker compose文件中工作。

我正在使用bitnami码头集装箱。

我一直得到502坏网关错误

这是我的docker-compose.yaml

version: '2'
services:
mariadb:
image: docker.io/bitnami/mariadb:10.3
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_magento
- MARIADB_DATABASE=bitnami_magento
volumes:
- 'mariadb_data:/bitnami/mariadb'
networks:
- magento-network
magento:
image: docker.io/bitnami/magento:2
environment:
- MAGENTO_HOST=mywebsite.com //is set to my domain, unsure if I should add https though
- MAGENTO_DATABASE_HOST=mariadb
- MAGENTO_DATABASE_PORT_NUMBER=3306
- MAGENTO_DATABASE_USER=bn_magento
- MAGENTO_DATABASE_NAME=bitnami_magento
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT_NUMBER=9200      
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- 'magento_data:/bitnami/magento'
depends_on:
- mariadb
- elasticsearch
networks:
- magento-network
- reverseproxy-nw
elasticsearch:
image: docker.io/bitnami/elasticsearch:7
volumes:
- 'elasticsearch_data:/bitnami/elasticsearch/data'
networks:
- magento-network
volumes:
mariadb_data:
magento_data:
elasticsearch_data:
networks:
magento-network:
reverseproxy-nw:
external: true

在Nginx代理管理器我有

scheme   forward hostname  port
http    magento_magento_1  8080

使用SSL强制SSL打开。

在magento的容器日志中,我可以看到:

[12/Jan/2022:21:38:38 +0000] "GET /favicon.ico HTTP/1.1" 302 -
[12/Jan/2022:21:40:06 +0000] "GET / HTTP/1.1" 302 -

当我试图打开一些面临502 Nginx问题的页面时,我安装了magento2,

在Nginx日志中,它显示

从上游读取响应标头时,上游发送的标头太大,

然后通过修改这个文件解决了这个问题

/etc/nginx/nginx.conf

在http{}中添加这行代码

fastcgi_buffers 16 16k;

fastcgi_buffer_size 32k;

proxy_buffer_size 128k;

proxy_ buffers 4 256k;

proxy_businy_buffers_size 256k;

有关更多详细信息,请参阅下面的链接

https://bobcares.com/blog/magento-502-bad-gateway/?unapproved=75360&适度哈希=21aca5cefbcdd86f62c492697cb64954#comment-75360

相关内容

  • 没有找到相关文章

最新更新