php - Magento 管理员在 nginx 上显示 ERR_TOO_MANY_REDIRECTS
问题描述
我正在尝试在单独的子域上设置 Magento 管理员,我正在关注本教程 [ https://magento2.atlassian.net/wiki/spaces/m1wiki/pages/14024833/Set+up+Magento+backend+on+a +separate+node]但以ERR_TOO_MANY_REDIRECTS
错误告终。
我仅在访问时遇到问题,admin.example.com/index.php/admin
或者admin.example.com
但我可以访问admin.example.com/test.php
.
下面是我的 nginx 配置文件,你能建议我缺少什么吗?
server {
listen 80;
server_name admin.example.com;
keepalive_timeout 70;
root /var/www/html/example.prod;
access_log /var/log/nginx/admin_access_log;
error_log /var/log/nginx/admin_error_log;
location / {
return 301 http://admin.example.com/index.php/admin;
#try_files $uri $uri/ @handler;
expires 30d;
}
location /app/ { deny all; }
location /includes/ { deny all; }
location /lib/ { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/ { deny all; }
location /report/config.xml { deny all; }
location /var/ { deny all; }
location /var/export/ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
autoindex on;
}
location /. {
return 404;
}
location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}
location ~ \.php$ {
try_files $uri =404;
expires off;
fastcgi_read_timeout 1800s;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
gzip on;
add_header "Access-Control-Allow-Origin" "*";
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain application/xml text/css text/js application/x-javascript;
}
解决方案
推荐阅读
- go - Hyperledger Fabric,golang中的嵌套结果迭代器 - 如何?链码启动失败
- c++ - C++ 原子栅栏和重新排序
- redis - 数据发布到redis时没有调用@SubscribeMessage('events')
- php - 在 Laravel 中通过 CSV 更新不同的数据
- akka - Akka - 无限次调用 preStart 方法
- javascript - 我的会话无法正常工作。一些数据未存储在节点 js 的会话中
- python - 在python中的文件中间读取具有新标题的数据文件
- c# - 使用 C# 在一个请求中发送和接收多个客户端证书
- odoo - 我如何在 odoo 中继承视图,这样如果我将某些内容更改为第一个视图,它不应该影响其他视图,或者反之亦然?
- python - 有没有一种简单的方法来了解哪些 kwargs 对 Python 中的方法或函数有效?