Advertisement
Guest User

Single Site Bedrock Nginx Config

a guest
Jan 2nd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.42 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         server_name example.ca;
  4.         return 301 https://$server_name$request_uri;
  5. }
  6.  
  7. server {
  8.  
  9.         server_name example.ca;
  10.         listen       *:443;
  11.  
  12.         access_log   /srv/www/example.ca/logs/example.ca.access.log;
  13.         error_log    /srv/www/example.ca/logs/example.ca.error.log;
  14.  
  15.         ssl     on;
  16.         ssl_certificate /etc/ssl/example.ca.cer;
  17.         ssl_certificate_key /etc/ssl/example.ca.key;
  18.  
  19.         ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
  20.  
  21.         root  /srv/www/example.ca/current/web;
  22.         index index.php;
  23.  
  24.         sendfile off;
  25.         client_max_body_size 12M;
  26.  
  27.  
  28.         location / {
  29.                 index index.php index.html index.htm;
  30.                 try_files $uri $uri/ /index.php?$args;
  31.         }
  32.  
  33.         location ~* \.(gif|jpg|jpeg|png|css|js)$ {
  34.                 expires max;
  35.         }
  36.  
  37.         location ~ \.php$ {
  38.                 try_files $uri =404;
  39.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  40.                 fastcgi_index index.php;
  41.                 fastcgi_pass  unix:/var/run/php-fpm/example.ca.sock;
  42.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43.                 include       fastcgi_params;
  44.         }
  45.  
  46.         # Deny access to any files with a .php extension in the uploads directory
  47.         location ~* /(?:uploads|files)/.*\.php$ {
  48.                         deny all;
  49.         }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement