Skip to content

Instantly share code, notes, and snippets.

@Maras0830
Created October 25, 2017 06:01
Show Gist options
  • Save Maras0830/37f3a650eea9b168e7359eb84ccbbc19 to your computer and use it in GitHub Desktop.
Save Maras0830/37f3a650eea9b168e7359eb84ccbbc19 to your computer and use it in GitHub Desktop.
laravel multiple project config.
server {
listen 80;
listen [::]:80;
root /var/www/Service/laravel_datacenter_api/public/;
server_name api.4gamers.dev;
index index.php index.html index.htm;
# resource v0,v1 api.
location / {
try_files $uri $uri/ $document_root/index.php$is_args$args;
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# resource v2 api
location ^~ /v2 {
alias /var/www/Service/laravel_resource_api_service/public/;
try_files $uri $uri/ $document_root/index.php$is_args$args;
error_log /var/log/nginx/v2-resource_api_service_error.log warn;
location ~ \.php$ {
try_files $uri $document_root/index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment