Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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