Guest User

/etc/nginx/sites-enabled/site-config.conf

a guest
Sep 30th, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.18 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         server_name www.sitename.net sitename.net;
  4.         root /var/www/sitename.net/public;
  5.         index index.html index.htm index.php;
  6.  
  7.         access_log  /var/www/sitename.net/access.log;
  8.         error_log  /var/www/sitename.net/error.log;
  9.  
  10.         # Directives to send expires headers and turn off 404 error logging.
  11.         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  12.                 expires max;
  13.                 log_not_found off;
  14.                 access_log off;
  15.         }
  16.  
  17.         location = /favicon.ico {
  18.                 log_not_found off;
  19.                 access_log off;
  20.         }
  21.  
  22.         location = /robots.txt {
  23.                 allow all;
  24.                 log_not_found off;
  25.                 access_log off;
  26.         }
  27.  
  28.         ## Disable viewing .htaccess & .htpassword
  29.         location ~ /\.ht {
  30.                 deny  all;
  31.         }
  32.  
  33.         location ~ ^/info/.* {
  34.                 allow 192.168.1.88/32; # To give one ip access
  35.         ##      allow 192.168.1.0/24; # To give a whole network access
  36.                 deny all;
  37.                 include /etc/nginx/php.conf;
  38.         }
  39.  
  40.         include /etc/nginx/php.conf;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment