0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravel nginx 404 Not Found

Posted at

環境

windows11
Laravel 9.52.10
nginx

http://localhost:7888/practice/public/xxx  →404 Not Found

nginxの設定ファイルを確認

nginx.conf
	server {
		listen               7888 default_server;

		# MAMP DOCUMENT_ROOT !! Don't remove this line !!
		root                 "C:/MAMP/htdocs/";

		access_log  C:/MAMP/logs/nginx_access.log;
		error_log  C:/MAMP/logs/nginx_error.log;

		location / {
			index            index.html index.php;
		}
#~省略~#
location ~ \.php$ {
			try_files        $uri =404;
			fastcgi_pass     127.0.0.1:9100;
			fastcgi_param    SCRIPT_FILENAME $document_root$fastcgi_script_name;
			include          fastcgi_params;
		}
追加したコード
location /practice/public/ {
        try_files $uri $uri/ /practice/public/index.php?$query_string;
        }

上記コードを追加したところ正常に稼働

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?