Chevereto Nginx pseudo-static rules

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
try_files $uri $uri/ /api.php;
}
location /admin {
try_files $uri /admin/index.php?$args;
}
location / { if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } try_files $uri $uri/ /api.php; } location /admin { try_files $uri /admin/index.php?$args; }
location / {
    if (-f $request_filename/index.html){
        rewrite (.*) $1/index.html break;
    }
    if (-f $request_filename/index.php){
        rewrite (.*) $1/index.php;
    }
    if (!-f $request_filename){
        rewrite (.*) /index.php;
    }
    try_files $uri $uri/ /api.php;
}
location /admin {
    try_files $uri /admin/index.php?$args;
}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#Chevereto: Disable access to sensitive files
location ~* /(app|content|lib)/.*\.(po|php|lock|sql){
deny all;
}
#Chevereto: CORS headers
location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /images/ {
location ~* (jpe?g|png|gif) {
log_not_found off;
error_page 404 /content/images/system/default/404.gif;
}
return 403;
}
#Chevereto: Pretty URLs
location / {
index index.php;
try_filesuri uri/ /index.php?query_string;
}
#Chevereto: Disable access to sensitive files location ~* /(app|content|lib)/.*\. (po|php|lock|sql){ deny all; } #Chevereto: CORS headers location ~* /.*\. (ttf|ttc|otf|eot|woff|woff2|font.css|css|js) { add_header Access-Control-Allow-Origin "*"; } #Chevereto: Upload path for image content only and set 404 replacement location ^~ /images/ { location ~* (jpe?g|png|gif) { log_not_found off; error_page 404 /content/images/system/default/404.gif; } return 403; } #Chevereto: Pretty URLs location / { index index.php; try_filesuri uri/ /index.php?query_string; }
#Chevereto: Disable access to sensitive files
location ~* /(app|content|lib)/.*\.(po|php|lock|sql){
    deny all;
}
#Chevereto: CORS headers
location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
    add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /images/ {
    location ~* (jpe?g|png|gif) {
        log_not_found off;
        error_page 404 /content/images/system/default/404.gif;
    }
    return 403;
}
#Chevereto: Pretty URLs
location / {
    index index.php;
    try_filesuri uri/ /index.php?query_string;
}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# Context limits
client_max_body_size 25M;
# Disable access to sensitive files
location ~* (app|content|lib)/.*\.(po|php|lock|sql)$ {
deny all;
}
# Image not found replacement
location ~ \.(jpe?g|png|gif|webp)$ {
log_not_found off;
error_page 404 /content/images/system/default/404.gif;
}
# CORS header (avoids font rendering issues)
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}
# Pretty URLs
location / {
index index.php;
try_files $uri $uri/ /index.php$is_args$query_string;
}
# Context limits client_max_body_size 25M; # Disable access to sensitive files location ~* (app|content|lib)/.*\. (po|php|lock|sql)$ { deny all; } # Image not found replacement location ~ \. (jpe?g|png|gif|webp)$ { log_not_found off; error_page 404 /content/images/system/default/404.gif; } # CORS header (avoids font rendering issues) location ~ \. (ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ { add_header Access-Control-Allow-Origin "*"; } # Pretty URLs location / { index index.php; try_files $uri $uri/ /index.php$is_args$query_string; }
# Context limits
client_max_body_size 25M;

# Disable access to sensitive files
location ~* (app|content|lib)/.*\.(po|php|lock|sql)$ {
    deny all;
}

# Image not found replacement
location ~ \.(jpe?g|png|gif|webp)$ {
    log_not_found off;
    error_page 404 /content/images/system/default/404.gif;
}

# CORS header (avoids font rendering issues)
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
    add_header Access-Control-Allow-Origin "*";
}

# Pretty URLs
location / {
    index index.php;
    try_files $uri $uri/ /index.php$is_args$query_string;
}

 

THE END
Thank you for your support
comments Be the first to grab
avatar
You are welcome to leave valuable insights!
submit
avatar

nickname

Cancel
nicknameexpressionImage

    There are no comments yet