Skip to content

Commit

Permalink
Updated NGINX instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
brcontainer committed May 14, 2024
1 parent c12e429 commit 33ff879
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
IndexIgnore *

# Redirect page errors to route system
ErrorDocument 401 /index.php/RESERVED.TEENY-401.html
ErrorDocument 403 /index.php/RESERVED.TEENY-403.html
ErrorDocument 500 /index.php/RESERVED.TEENY-500.html
ErrorDocument 501 /index.php/RESERVED.TEENY-501.html

RewriteEngine On

# Ignore hidden files
RewriteRule (^\.|/\.) index.php [L]
RewriteRule ^\.|/\. index.php [L]

# Redirect to public folder
RewriteCond %{REQUEST_URI} !(^$|public/|index\.php(/|$))
Expand Down
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,36 @@ For NGINX you can use [`try_files`](https://nginx.org/en/docs/http/ngx_http_core

```
location / {
root /home/foo/bar/teeny;
index index.html index.htm index.php;
# Redirect page errors to route system
error_page 403 /index.php/RESERVED.TEENY-403.html;
error_page 500 /index.php/RESERVED.TEENY-500.html;
error_page 501 /index.php/RESERVED.TEENY-501.html;
try_files /public$uri /index.php?$query_string;
location = / {
try_files $uri /index.php?$query_string;
}
location ~ /\. {
return 404;
try_files /index.php$uri /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000; # Replace by your FastCGI or FPM
# Replace by your FPM or FastCGI
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
include fastcgi_params;
# Redirect page errors to route system
error_page 401 /index.php/RESERVED.TEENY-401.html;
error_page 403 /index.php/RESERVED.TEENY-403.html;
error_page 404 /index.php/RESERVED.TEENY-404.html;
error_page 500 /index.php/RESERVED.TEENY-500.html;
error_page 501 /index.php/RESERVED.TEENY-501.html;
set $teeny_suffix "";
if ($uri != "/index.php") {
set $teeny_suffix "/public";
}
try_files /public/$uri /index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$teeny_suffix$fastcgi_script_name;
}
}
```

Expand Down

0 comments on commit 33ff879

Please sign in to comment.