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; }
#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; }
# 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
暂无评论内容