简体   繁体   English

Nginx conf的Codeigniter结果404

[英]Nginx conf for codeigniter result 404

I have setup my nginx conf following this link for my codeigniter server block https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/ with some addition like this 我在此链接后为我的codeigniter服务器块https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/设置了我的Nginx conf,并添加了一些类似的内容

server {
    listen       80;
    server_name  domain.com;
    autoindex on;

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

    location / {
        try_files $uri $uri/ /index.php;

        location = /index.php {
              fastcgi_pass unix:/var/run/php5-fpm.sock;
              fastcgi_param  SCRIPT_FILENAME /var/www/server$fastcgi_script_name;
              include        fastcgi_params;
        }
    }

    location ~ \.php$ {
        return 444;
    }


    location ~* ^/(assets|files|robots\.txt) { }
    location ~ /\.ht {
        deny        all;
    }
}

But turns out still routed to error_404 default by CI. 但是事实证明,CI仍将其路由到error_404默认值。 Anybody could enlighten me? 有人可以启发我吗? Thanks 谢谢

it's resolved, no need for nginx conf. 它已解决,不需要nginx conf。 Merely from small mistakes with filename 仅仅是文件名的小错误

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

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