File tree Expand file tree Collapse file tree 2 files changed +43
-21
lines changed Expand file tree Collapse file tree 2 files changed +43
-21
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ sudo $SED -i "s!ROOT!$WEB_DIR/$SITE_DIR!g" $CONFIG
3131
3232# set up web root
3333sudo mkdir $WEB_DIR /$SITE_DIR
34- sudo chown nginx:nginx -R $WEB_DIR /$SITE_DIR
34+ sudo chown vagrant:vagrant -R $WEB_DIR /$SITE_DIR
3535sudo chmod 600 $CONFIG
3636
3737# create symlink to enable site
@@ -43,6 +43,6 @@ sudo /usr/local/nginx/sbin/nginx -s reload
4343# put the template index.html file into the new domains web dir
4444sudo cp $CURRENT_DIR /index.html.template $WEB_DIR /$SITE_DIR /index.html
4545sudo $SED -i " s/SITE/$DOMAIN /g" $WEB_DIR /$SITE_DIR /index.html
46- sudo chown nginx:nginx $WEB_DIR /$SITE_DIR /index.html
46+ sudo chown vagrant:vagrant $WEB_DIR /$SITE_DIR /index.html
4747
4848echo " Site Created for $DOMAIN "
Original file line number Diff line number Diff line change 1- server {
2- server_name www.DOMAIN DOMAIN;
3-
4- root ROOT;
5-
6- access_log /var/log/nginx/DOMAIN.access.log;
7-
8- index index.html index.htm;
9-
10- # serve static files directly
11- location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
12- access_log off;
13- expires max;
14- }
15-
16- location ~ /\.ht {
17- deny all;
18- }
19- }
1+ server
2+ {
3+ listen 80;
4+ autoindex on;
5+ index index.html index.htm index.php;
6+ server_name www.DOMAIN DOMAIN;
7+ root ROOT;
8+
9+ access_log /var/log/nginx/DOMAIN.access.log;
10+ location / {
11+ if (!-e $request_filename) {
12+ rewrite ^(.*)$ /index.php$1 last;
13+ break;
14+ }
15+ }
16+
17+ location ~ .+\.php($|/) {
18+ fastcgi_pass 127.0.0.1:9000;
19+ fastcgi_index index.php?IF_REWRITE=1;
20+ include fastcgi_params;
21+
22+ set $script $uri;
23+ set $path_info "/";
24+ if ($uri ~ "^(.+\.php)(/.+)") {
25+ set $script $1;
26+ set $path_info $2;
27+ }
28+ fastcgi_param PHP_VALUE "session.cookie_domain=DOMAIN";
29+ fastcgi_param PATH_INFO $path_info;
30+ fastcgi_param SCRIPT_FILENAME $document_root/$script;
31+ fastcgi_param SCRIPT_NAME $script;
32+ access_log off;
33+ }
34+ location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
35+ expires 30d;
36+ access_log off;
37+ }
38+ location ~ .*\.(js|css)?$ {
39+ access_log off;
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments