小编Sol*_*rac的帖子

内部重定向到"/index.html"时,Nginx重写或内部重定向循环

我使用Php框架在没有任何index.html的情况下在nginx上实现web服务器,网页工作正常,但是有些脚本不工作,它说"500内部服务器错误"

这是服务器日志

2016/11/16 11:08:38 [错误] 2551#0:*738重写或内部重定向循环,同时内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/kelontong/getKelontong HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:09:20 [错误] 2551#0:*746重写或内部重定向循环,内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/kelontong/getKelontong HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:14:47 [错误] 5500#0:*4重写或内部重定向循环,内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/department/HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:14:48 [错误] 5500#0:*6重写或内部重定向循环,同时内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/department/getdepartment HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:18:56 [错误] 5518#0:*4重写或内部重定向循环,同时内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/department/getdepartment HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:18:56 [错误] 5520#0:*8重写或内部重定向循环,内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/department/getdepartment HTTP/1.1",主持人:"192.168.70.86"

2016/11/16 11:21:35 [错误] 5534#0:*3重写或内部重定向循环,同时内部重定向到"/index.html",客户端:27.131.251.6,服务器:www.foreverstore.id,请求:"GET/department/getdepartment HTTP/1.1",主持人:"192.168.70.86"

这是我的nginx主机配置文件

server {
 listen 443 ssl http2;

 root /bwi/foreverstore.id;
 index index.html index.htm index.php;


 server_name www.foreverstore.id ;
 ssl_certificate /etc/nginx/ssl/foreverstore.crt;
 ssl_certificate_key /etc/nginx/ssl/foreverstore.key;

 location / {

    try_files $uri $uri/ /index.html;
    #  try_files $uri $uri/ =404;
    # Uncomment to enable naxsi on this location
    # include /etc/nginx/naxsi.rules
 } …
Run Code Online (Sandbox Code Playgroud)

php nginx web

7
推荐指数
1
解决办法
9842
查看次数

当使用自定义会话处理程序并建立了第二个postgres连接时,PHP7会破坏我的会话

使用自定义会话处理程序在postgreSQL服务器上保存会话时,打开一个第二个postgres连接,如果存在任何unicode字符,会话将中断!

这是我的自定义会话处理程序:

class custom_session_handler implements SessionHandlerInterface {

    protected $nombre_de_sesion, $tiempo_de_vida, $db;

    public function open($savePath, $sessionName) {
        $this->db = pg_connect("host=**** port=5432 dbname=**** user=**** password=***") or die('Imposible conectar con la base de datos de sesiones');
        $this->gc(time());
        $this->nombre_de_sesion = trim($sessionName);
        $this->tiempo_de_vida = pg_escape_literal(time() + 2500);
        return (isset($this->nombre_de_sesion) && strlen($this->nombre_de_sesion) > 2) ? true : false;
    }

    public function close() {
        return pg_close($this->db);
    }

    public function destroy($session_id) {
        return pg_affected_rows(pg_query($this->db, 'DELETE FROM "sesiones_soporte" WHERE session_id = ' . pg_escape_literal($session_id) . '')) ? true : …
Run Code Online (Sandbox Code Playgroud)

php postgresql session

5
推荐指数
1
解决办法
2151
查看次数

标签 统计

php ×2

nginx ×1

postgresql ×1

session ×1

web ×1