File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # Author: Seb Dangerfield
3
- # URL: http://sebdangerfield.me.uk
4
- #
5
2
6
3
NGINX_ALL_VHOSTS=' /etc/nginx/sites-available'
7
4
NGINX_ENABLED_VHOSTS=' /etc/nginx/sites-enabled'
29
26
USERNAME=' www-data'
30
27
HOME_DIR=$DOMAIN
31
28
32
- # Create a new user!
33
- # echo "Please specify the username for this site?"
34
- # read USERNAME
35
- # sudo adduser -d$WEB_DIR/$USERNAME $USERNAME
36
- # echo "Please enter a password for the user: $USERNAME"
37
- # read -s PASS
38
- # sudo echo $PASS | sudo passwd --stdin $USERNAME
39
-
40
29
# Now we need to copy the virtual host template
41
30
CONFIG=$NGINX_ALL_VHOSTS /$DOMAIN .conf
42
31
sudo cp $CURRENT_DIR /virtual_host.template $CONFIG
Original file line number Diff line number Diff line change 4
4
root ROOT;
5
5
6
6
access_log /var/log/nginx/DOMAIN.access.log;
7
+ error_log /var/log/nginx/DOMAIN.error.log
7
8
8
9
index index.html index.htm;
9
10
@@ -16,4 +17,21 @@ server {
16
17
location ~ /\.ht {
17
18
deny all;
18
19
}
20
+
21
+ location ~ \.php$ {
22
+ root ROOT;
23
+ try_files $uri $uri/ /index.php?$args ;
24
+ index index.html index.htm index.php;
25
+ fastcgi_index index.php;
26
+ fastcgi_param PATH_INFO $fastcgi_path_info;
27
+ fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
28
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
29
+ fastcgi_param APP_ENV dev;
30
+
31
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
32
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
33
+ include fastcgi_params;
34
+ }
35
+
36
+ sendfile off;
19
37
}
You can’t perform that action at this time.
0 commit comments