我的同事和我已经浏览了几篇stackoverflow帖子和其他文章,但无法弄清楚为什么我们仍然得到一个重定向循环。我们是NGINX的新手,所以我们觉得我们的配置文件有问题。
我们在以下代码中的想法如下:
我们在这里俯瞰什么?
server {
listen 80;
server_name www.site.org;
rewrite ^/(.*) http://example.org/$1 permanent;
}
server {
listen 80;
server_name example.org;
root /home/site/sites/example.org;
if ($scheme = http){
rewrite ^/test11$ https://example.org/test11 redirect;
}
rewrite ^/member$ /members permanent;
rewrite ^/system$ /system/index.php permanent;
location / {
index index.php index.html;
try_files $uri $uri/ @ee;
}
location @ee {
rewrite ^/(.*)/$ /$1 permanent;
rewrite ^(.*) /index.php?$1 last;
}
location ~ /.git {
deny all;
}
real_ip_header X-Forwarded-For;
}
server {
listen 443 ssl;
server_name example.org;
ssl on;
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/cert.key;
root /home/site/sites/example.org;
}