Skip to content

Instantly share code, notes, and snippets.

@uhlhosting
Last active July 18, 2016 13:44
Show Gist options
  • Save uhlhosting/e9c437d98844a421ad6c336f4665ead2 to your computer and use it in GitHub Desktop.
Save uhlhosting/e9c437d98844a421ad6c336f4665ead2 to your computer and use it in GitHub Desktop.
Nginx Amplify errors
Warning – Location defined as regex has a valid regex operator, but does not include a regex pattern. It is generally more efficient to configure exact or prefix matching for locations that do not really require regex matching. Please refer the documentation describing location directive.
Check the following file(s):
/etc/nginx/conf.d/default.conf, line 114
Warning – location defined as regex has a regex pattern that does not include ^ or $. It is recommended that the regex pattern always includes anchors ^ and $.
Check the following file(s):
/etc/nginx/conf.d/default.conf, line 114
Warning – location defined as regex is set up for case-insensitive matching. It is recommended to generally avoid case-insensitive matching for regex locations since it’s prone to many errors.
Check the following file(s):
/etc/nginx/conf.d/default.conf, line 56
/etc/nginx/conf.d/default.conf, line 34
/etc/nginx/conf.d/default.conf, line 45
/etc/nginx/conf.d/default.conf, line 66
# /**
# * @version 1.6.1
# * @package Engintron for cPanel/WHM
# * @author Fotis Evangelou
# * @url https://engintron.com
# * @copyright Copyright (c) 2010 - 2016 Nuevvo Webware P.C. All rights reserved.
# * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
# */
server {
listen 80 default_server;
#listen [::]:443 default_server; # Uncomment if your server supports IPv6
server_name localhost;
set $PROXY_DOMAIN_OR_IP $host;
# Set custom rules like domain/IP exclusions or redirects here
include custom_rules;
location / {
try_files $uri $uri/ @backend;
}
location @backend {
include proxy_params_common;
# === MICRO CACHING ===
# Comment the following line to disable 1 second micro-caching for dynamic HTML content
include proxy_params_dynamic;
}
# Enable browser cache for static content files (TTL is 1 hour)
location ~* \.(?:json|xml|rss|atom)$ {
include proxy_params_common;
include proxy_params_static;
expires 1h;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Vary "Accept-Encoding";
access_log off;
}
# Enable browser cache for CSS / JS (TTL is 30 days)
location ~* \.(?:css|js)$ {
include proxy_params_common;
include proxy_params_static;
expires 30d;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Vary "Accept-Encoding";
access_log off;
}
# Enable browser cache for media & document files (TTL is 60 days)
location ~* \.(?:ico|jpg|jpeg|gif|png|bmp|webp|tiff|mp3|flac|ogg|mid|midi|wav|wma|mp4|mov|3gp|webm|mkv|ogv|wmv|zip|7z|tgz|gz|rar|bz2|tar|exe|pdf|doc|docx|xls|xlsx|ppt|pptx|rtf|odt|ods|odp)$ {
include proxy_params_common;
include proxy_params_static;
expires 60d;
add_header Pragma "public";
add_header Cache-Control "public";
access_log off;
}
# Enable browser cache for fonts & fix @font-face cross-domain restriction (TTL is 60 days)
location ~* \.(eot|ttf|otf|woff|woff2|svg|svgz)$ {
include proxy_params_common;
include proxy_params_static;
expires 60d;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Vary "Accept-Encoding";
add_header Access-Control-Allow-Origin *;
access_log off;
}
# Prevent logging of favicon and robot request errors
location = /favicon.ico {
include proxy_params_common;
include proxy_params_static;
expires 60d;
add_header Pragma "public";
add_header Cache-Control "public";
access_log off;
log_not_found off;
}
location = /robots.txt {
include proxy_params_common;
include proxy_params_static;
expires 1d;
add_header Pragma "public";
add_header Cache-Control "public";
access_log off;
log_not_found off;
}
location = /nginx_status {
stub_status;
access_log off;
log_not_found off;
# Comment the following 2 lines to make the Nginx status page public
allow 127.0.0.1;
deny all;
}
location = /whm-server-status {
proxy_pass http://127.0.0.1:8080;
# Comment the following 2 lines to make the Apache status page public
allow 127.0.0.1;
deny all;
}
# Deny access to hidden files
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment