2020-04-27 23:59:38 1918次浏览 1条回答 0 悬赏 30 金钱

Yii2 的版本,安装了 https://github.com/codemix/yii2-localeurls 多语言的设置

服务器这边 nginx+apache 动静分离的

nginx+php-fpm,使用没有问题,但是 nginx 转发给 apache 后,页面一直不停的重定向

是不是因为 nginx 里面重写了,又在apache里重写了导致的?

【nginx】

location / {
      index index.php;

      try_files $uri $uri/ /index.php?$args;
      #if (!-e $request_filename){
      #       rewrite ^/(.*) /index.php last;
      #}
      # 上面两个开哪个都一样,除非nginx直接用php
}
location ~ \.php$ {
        proxy_set_header  Host $host;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass https://127.0.0.1:4433;
}

【apache】

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
RewriteRule ^index.php/ - [L,R=404]
您需要登录后才可以回答。登录 | 立即注册
醉挽清风
见习主管

醉挽清风 南京

注册时间:2018-07-03
最后登录:2022-09-06
在线时长:15小时38分
  • 粉丝1
  • 金钱180
  • 威望10
  • 积分430

热门问题