繁体   English   中英

无限循环 Nginx php-fpm 重定向到另一个索引。php

[英]Infinite loop Nginx php-fpm redirect to another index.php

基于该架构:

├── application
├── assets
├── bloxby_enterprise_1_4_0.zip
├── build
├── ci_3.1.9
├── config.ini
├── elements
├── _htaccess
├── images
├── img
├── index.php
├── install
├── license.txt
├── Makefile
├── node_modules
├── package.ini
├── package.json
├── package-lock.json
├── README-.md
├── README.md
├── tmp
├── vendor
└── webpack.config.js

我正在尝试使用 nginx 公开我的网站。 我的 index.php 重定向到/install另一个 index.php 应该启动我的安装。

我成功公开了我的网站并点击了第一个索引。php。 进行了重定向,但我陷入了无限循环。 有什么线索吗? 这是我的 nginx conf。

server {
    index index.php;
    listen             80;
    server_name XXX;
    return       301 https://XXX$request_uri;
}


server {
    listen       443;
    ssl on;
    server_name XXX;
    root /opt/participate;
    index index.php /install/.index.php

    error_log /var/log/nginx/XXX.log;
    access_log /var/log/nginx/XXX.log;

    ssl_certificate /etc/letsencrypt/live/XXX/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/XXX/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


location / {
        try_files $uri  /index.php$is_args$args;
   } 


location ~ ^/index\.php(/|$) {
        fastcgi_pass localhost:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }

    # return 404 for all other php files not matching the front controller
    # this prevents access to other php files you don't want to be accessible.
    #location ~ \.php$ {
    #    return 404;
    #}




}
location / {
        try_files $uri  /install/index.php$is_args$args;
   } 


location ~ ^/index\.php(/|$) {
        fastcgi_pass localhost:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }
    # return 404 for all other php files not matching the front controller
    # this prevents access to other php files you don't want to be accessible.
    #location ~ \.php$ {
    #    return 404;
    #}

只是在安装的时候。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM