Last active
February 17, 2021 19:41
-
-
Save tkuchiki/5699419 to your computer and use it in GitHub Desktop.
Kohana nginx configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.com; | |
access_log /path/to/access.log main; | |
error_log /path/to/error.log; | |
root /path/to/kohana/web; | |
location / { | |
index index.php; | |
if (-f $request_filename) { | |
break; | |
} | |
try_files $uri $uri/ @kohana; | |
} | |
# kohana ディレクトリ以下に 全て設置している初期状態の時のみ必要 | |
#location ~* ^/(modules|application|system) { | |
# return 403; | |
#} | |
location ~* \.php$ { | |
try_files $uri $uri/ @kohana; | |
fastcgi_pass unix:/var/run/php-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
#fastcgi_param SCRIPT_FILENAME /path/to/fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location @kohana { | |
fastcgi_pass unix:/var/run/php-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root/index.php; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment