Advertisement
ovizii

/etc/nginx/sites-enabled/knightsenglish.com.conf

Nov 13th, 2016
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.22 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen [::]:80;
  4.  
  5.     server_name knightsenglish.com www.knightsenglish.com;
  6.  
  7.     return 301 https://www.knightsenglish.com$request_uri;
  8. }
  9.  
  10. server {
  11.     listen 443 ssl http2;
  12.     listen [::]:443 ssl http2;
  13.  
  14.     server_name knightsenglish.com;
  15.  
  16.     return 301 https://www.knightsenglish.com$request_uri;
  17.    
  18.     # include your HTTPS config here
  19. }
  20.  
  21. server
  22. {
  23.     listen 443 ssl http2;
  24.     listen [::]:443 ssl http2;
  25.  
  26.         server_name www.knightsenglish.com;
  27.  
  28.         ssl_certificate /etc/ssl/private/www.knightsenglish.com.crt;
  29.         ssl_certificate_key /etc/ssl/private/www.knightsenglish.com.key;
  30.  
  31.     root /var/www/knightsenglish.com/public;
  32.     index index.html index.htm index.php;
  33.     client_max_body_size 32m;
  34.  
  35.     access_log  /var/www/knightsenglish.com/access.log;
  36.     error_log  /var/www/knightsenglish.com/error.log;
  37.  
  38.     # Directives to send expires headers and turn off 404 error logging.
  39.  
  40.     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$
  41.     {
  42.         expires max;
  43.         log_not_found off;
  44.         access_log off;
  45.     }
  46.  
  47.     location = /favicon.ico {
  48.         log_not_found off;
  49.         access_log off;
  50.     }
  51.  
  52.     location = /robots.txt {
  53.         allow all;
  54.         log_not_found off;
  55.         access_log off;
  56.     }
  57.    
  58.     ## Disable viewing .htaccess & .htpassword
  59.     location ~ /\.ht {
  60.         deny  all;
  61.     }
  62.  
  63. location ~* /wp-includes/.*.php$ {
  64.     deny all;
  65.     access_log off;
  66.     log_not_found off;
  67. }
  68.  
  69. location ~* /(?:uploads|files)/.*.php$ {
  70.     deny all;
  71.     access_log off;
  72.     log_not_found off;
  73. }
  74.  
  75. location = /xmlrpc.php {
  76.     deny all;
  77.     access_log off;
  78.     log_not_found off;
  79. }
  80.  
  81. location ~ /readme\.(txt|html)$ {
  82.          deny  all;
  83.          access_log off;
  84.          log_not_found off;
  85. }
  86.  
  87.  
  88.     include /etc/nginx/php.conf;
  89.  
  90.     # rewriting for mailpress tracking configuration
  91.     # wasn't working so its deactivated, tracking should work without
  92.     #location /mail {
  93.     #rewrite ^/mail/analytics/([l|o])-([0-9]+)-([h|p])-([0-9a-zA-Z]+).html /wp-content/plugins/mailpress/mp-includes/action.php?tg=$1&mm=$2&co=$3&us=$4 break;
  94.     #rewrite ^/mail/analytics/([l|o])-([0-9]+)-([h|p])-([0-9a-zA-Z]+).html /wp-content/plugins/mailpress/mp-includes/action.php?tg=$1&mm=$2&co=$3&us=$4 last;
  95.     #}
  96.  
  97.  
  98.     #checking for bots
  99.     #if ( $is_bot )
  100.     #{
  101.         #return 444;
  102.     #}
  103.    
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement