Skip to content

Instantly share code, notes, and snippets.

@nclundsten
Created December 12, 2013 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nclundsten/7930532 to your computer and use it in GitHub Desktop.
Save nclundsten/7930532 to your computer and use it in GitHub Desktop.
~
nlundsten $ cat /etc/nginx/conf.d/virtual.conf
server {
listen 80;
server_name .dev;
set $basepath "/home/nlundsten/workspace";
set $domain $host;
set $rootpath "Misc";
if ($domain ~ "^(.*)\.dev$") {
set $domain $1;
}
if (-d $basepath/$domain/public) {
set $rootpath "${domain}/public";
}
if (-d $basepath/$domain/httpdocs) {
set $rootpath "${domain}/httpdocs";
}
if (-f $basepath/$domain/index.php) {
set $rootpath $domain;
}
root $basepath/$rootpath;
include conf.d/php_fpm;
include conf.d/indexphp_rewrite;
include conf.d/block_ht;
}
~
nlundsten $ cat /etc/nginx/conf.d/php_fpm
index index.php index.html;
location ~ .php$ {
error_page 404 = /index.php;
if (!-f $request_filename) {
return 404;
}
fastcgi_split_path_info ^(.+\.php)(.*)$;
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_read_timeout 120;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
~
nlundsten $ cat /etc/nginx/conf.d/indexphp_rewrite
location / {
try_files $uri $uri/ /index.php?$args;
}
~
nlundsten $ cat /etc/nginx/conf.d/block_ht
# deny htaccess, etc
location ~ /\.ht {
deny all;
}~
nlundsten $ ~/screenshot
/usr/bin/xclip
Key was pressed, aborting shot
giblib error: no image grabbed
Traceback (most recent call last):
File "/home/nlundsten/GtkGrab/screenshot", line 39, in <module>
data = base64.b64encode(open(path, 'r').read())
IOError: [Errno 2] No such file or directory: '/tmp/ss.png'
~
nlundsten $ ~/screenshot
/usr/bin/xclip
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment