Skip to content

Instantly share code, notes, and snippets.

@zeromodule
Created December 4, 2015 13:29
Show Gist options
  • Save zeromodule/d53aa295b46b52cbeda9 to your computer and use it in GitHub Desktop.
Save zeromodule/d53aa295b46b52cbeda9 to your computer and use it in GitHub Desktop.
vagrant@local.round.me:~$ cat /etc/nginx/sites-available/dashboard.conf
server {
server_name dashboard.local.round.me;
set $root_path "/git/dashboard";
access_log /var/log/nginx/access_dashboard.log;
error_log /var/log/nginx/error_dashboard.last.log info;
root $root_path;
location ~* ^/upload {
root $root_path;
try_files $uri =404;
}
location ~* ^/api/(?<query>.+)$ {
root $root_path/backend/web;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.roundme.sock;
#fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
#include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param SCRIPT_NAME /index.php;
#fastcgi_param QUERY_STRING $query;
fastcgi_param REQUEST_URI $query;
}
location ~ \.(js|json|css|png|svg|jpe?g|eot|woff|ttf|woff2|html)$ {
root "$root_path/frontend/app";
try_files $uri =404;
}
location / {
root "$root_path/frontend/app";
try_files $uri /index.html =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment