Skip to content

Instantly share code, notes, and snippets.

@jerronimo
Created March 18, 2017 15:32
Show Gist options
  • Save jerronimo/7d9149a71dd2f26adb67ab2df4544efb to your computer and use it in GitHub Desktop.
Save jerronimo/7d9149a71dd2f26adb67ab2df4544efb to your computer and use it in GitHub Desktop.
server {
listen 80 default_server;
index index.html;
root /var/www/frontend/dist;
charset utf-8;
rewrite_log on;
access_log off;
error_log /var/log/nginx/error.log error;
sendfile off;
client_max_body_size 100m;
location ~ ^/dashboard/ {
alias /var/www/backendDashboard/dist/$1;
try_files $uri /index.html?$args;
}
location / {
try_files $uri /index.html?$args;
}
location ~* ^.+\.(css|img|js|flv|swf|download|png|gif|jpe?g|woff|ttf|html|svg|ico|woff2|json)$ {
fastcgi_intercept_errors on;
log_not_found off;
try_files $uri =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ ^/(api)/ {
root /var/www/public;
try_files /index.php =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param APP_ENV dev;
fastcgi_pass app:9000;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment