簡體   English   中英

Nginx conf的Codeigniter結果404

[英]Nginx conf for codeigniter result 404

我在此鏈接后為我的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;
    }
}

但是事實證明,CI仍將其路由到error_404默認值。 有人可以啟發我嗎? 謝謝

它已解決,不需要nginx conf。 僅僅是文件名的小錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM