Advertisement
petrovnn

/etc/nginx/sites-available/site.com

Nov 9th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.13 KB | None | 0 0
  1. # -*- mode: nginx; mode: flyspell-prog;  ispell-current-dictionary: american -*-
  2. ### Configuration for example.com.
  3.  
  4. ## Return (no rewrite) server block.
  5. server {
  6.     ## This is to avoid the spurious if for sub-domain name
  7.     ## "rewriting".
  8.     listen 80; # IPv4
  9.        
  10.     server_name www.site.com;
  11.     return 301 $scheme://site.com$request_uri;
  12.  
  13. } # server domain return.
  14.  
  15. ## HTTP server.
  16. server {
  17.     listen 80; # IPv4
  18.  
  19.     server_name site.com;
  20.     limit_conn arbeit 32;
  21.  
  22.  
  23.      ## Access and error logs.
  24.     access_log /var/log/nginx/site.com_access.log;
  25.     error_log /var/log/nginx/site.com_error.log;
  26.  
  27.     ## See the blacklist.conf file at the parent dir: /etc/nginx.
  28.     ## Deny access based on the User-Agent header.
  29.     if ($bad_bot) {
  30.         return 444;
  31.     }
  32.     ## Deny access based on the Referer header.
  33.     if ($bad_referer) {
  34.         return 444;
  35.     }
  36.  
  37.     ## Protection against illegal HTTP methods. Out of the box only HEAD,
  38.     ## GET and POST are allowed.
  39.     if ($not_allowed_method) {
  40.         return 405;
  41.     }
  42.  
  43.     ## Filesystem root of the site and index.
  44.     root /var/www/sites/site.com;
  45.     index index.php;
  46.  
  47.     ## If you're using a Nginx version greater or equal to 1.1.4 then
  48.     ## you can use keep alive connections to the upstream be it
  49.     ## FastCGI or Apache. If that's not the case comment out the line below.
  50.     fastcgi_keep_conn on; # keep alive to the FCGI upstream
  51.  
  52.     ## Uncomment if you're proxying to Apache for handling PHP.
  53.     #proxy_http_version 1.1; # keep alive to the Apache upstream
  54.  
  55.     ################################################################
  56.     ### Generic configuration: for most Drupal 7 sites.
  57.     ################################################################
  58.     include apps/drupal/drupal.conf;
  59.  
  60.     ################################################################
  61.     ### Configuration for Drupal 7 sites to serve URIs that need
  62.     ### to be **escaped**
  63.     ################################################################
  64.     #include apps/drupal/drupal_escaped.conf;
  65.  
  66.     #################################################################
  67.     ### Configuration for Drupal 7 sites that use boost.
  68.     #################################################################
  69.     #include apps/drupal/drupal_boost.conf;
  70.  
  71.     #################################################################
  72.     ### Configuration for Drupal 7 sites that use boost if having
  73.     ### to serve URIs that need to be **escaped**
  74.     #################################################################
  75.     #include apps/drupal/drupal_boost_escaped.conf;
  76.  
  77.     #################################################################
  78.     ### Configuration for updating the site via update.php and running
  79.     ### cron externally. If you don't use drush for running cron use
  80.     ### the configuration below.
  81.     #################################################################
  82.     #include apps/drupal/drupal_cron_update.conf;
  83.  
  84.     ################################################################
  85.     ### Installation handling. This should be commented out after
  86.     ### installation if on an already installed site there's no need
  87.     ### to touch it. If on a yet to be installed site. Uncomment the
  88.     ### line below and comment out after installation. Note that
  89.     ### there's a basic auth in front as secondary ligne of defense.
  90.     ################################################################
  91.     #include apps/drupal/drupal_install.conf;
  92.  
  93.     #################################################################
  94.     ### Support for upload progress bar. Configurations differ for
  95.     ### Drupal 6 and Drupal 7.
  96.     #################################################################
  97.     include apps/drupal/drupal_upload_progress.conf;
  98.  
  99.     ## Including the php-fpm status and ping pages config.
  100.     ## Uncomment to enable if you're running php-fpm.
  101.     #include php_fpm_status_vhost.conf;
  102.  
  103.     ## Including the Nginx stub status page for having stats about
  104.     ## Nginx activity: http://wiki.nginx.org/HttpStubStatusModule.
  105.     include nginx_status_vhost.conf;
  106.  
  107.  
  108. } # HTTP server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement