-
-
Save nhatphamcdn/e1cd31a615de3b03c03bca07f1d76ab8 to your computer and use it in GitHub Desktop.
Revisions
-
MetalGuardian revised this gist
Nov 4, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,9 @@ server { } # allow php only in root index.php #location ~ "^/index\.php$" { # allow execute all php files location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; -
MetalGuardian revised this gist
Nov 4, 2012 . 2 changed files with 44 additions and 55 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,14 @@ server { set $domain $host; # check one name domain for simple application if ($domain ~ "^(.[^.]*)\.dev$") { set $domain $1; set $rootpath "${domain}"; set $servername "${domain}.dev"; } # check multi name domain to multi application if ($domain ~ "^(.*)\.(.[^.]*)\.dev$") { set $subdomain $1; set $domain $2; @@ -19,13 +21,18 @@ server { server_name $servername; access_log "/var/log/nginx/server.${servername}.access.log"; error_log "/var/log/nginx/server.dev.error.log"; root $basepath/$rootpath; # check file exist and send request sting to index.php location / { try_files $uri $uri/ /index.php?$args; } # allow php only in root index.php location ~ "^/index\.php$" { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -34,11 +41,45 @@ server { include fastcgi_params; } # configure phpmyadmin path location /phpmyadmin { root /usr/share/; index index.php; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } # disallow access to apache configs location ~ /\.ht { deny all; } # disallow access to git configs path location ~ /\.git { deny all; } # disallow access to yii code path location ~ /(protected|themes/classic/views)/ { deny all; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,52 +0,0 @@ -
MetalGuardian revised this gist
Nov 4, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ # sudo apt-get install dnsmasq # echo "address=/.dev/127.0.0.1" >> /etc/dnsmasq.conf -
MetalGuardian revised this gist
Nov 4, 2012 . 1 changed file with 52 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ server { root /var/www; index index.php; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } location ~ /\.git { deny all; } location /phpmyadmin { root /usr/share/; index index.php; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } } -
MetalGuardian renamed this gist
Nov 4, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
MetalGuardian revised this gist
Nov 4, 2012 . 1 changed file with 44 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,44 @@ server { index index.php; set $basepath "/var/www"; set $domain $host; if ($domain ~ "^(.[^.]*)\.dev$") { set $domain $1; set $rootpath "${domain}"; set $servername "${domain}.dev"; } if ($domain ~ "^(.*)\.(.[^.]*)\.dev$") { set $subdomain $1; set $domain $2; set $rootpath "${domain}/${subdomain}/www/"; set $servername "${subdomain}.${domain}.dev"; } server_name $servername; root $basepath/$rootpath; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } location ~ /\.git { deny all; } } -
MetalGuardian created this gist
Nov 4, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ server{}