簡體   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