Nginx上的WordPress管理面板循环

时间:2017-12-18 作者:Daler

在为wordpress permalinks更新我的nginx conf文件后,wordpress管理员页面启动重定向循环。为什么?我怎样才能解决这个问题?

我的nginx conf文件:

server {
    listen 80;
    server_name en.mig.tj ru.mig.tj;

    access_log /var/log/nginx/mig.access.log;
    error_log /var/log/nginx/mig.error.log;

    root /var/www/mig;
    index index.php index.html index.htm;

    location / {
        index index.php index.html index.htm;
        try_files $uri $uri /index.php?args;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
        root /var/www/mig;
    }

    location ~ \\.php$ {
        try_files $uri =404;

        fastcgi_pass php5;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 256 16k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;

        include fastcgi_params;
    }
}

1 个回复
SO网友:Daler

通过将此行添加到我的conf文件中,找到了我的问题的解决方案:

try_files $uri $uri/ /index.php;

结束