Skip to content

Commit

Permalink
yii-starter-kit#654. Testing nginx config for PWD.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredleo committed Feb 27, 2019
1 parent 670f461 commit f50bd7e
Showing 1 changed file with 1 addition and 99 deletions.
100 changes: 1 addition & 99 deletions docker/nginx/vhost.conf
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
## API ##
server {
listen 80;

root /app/api/web;
index index.php index.html;

server_name api.yii2-starter-kit.localhost;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$args;
}

client_max_body_size 32m;

# There is a VirtualBox bug related to sendfile that can lead to
# corrupted files, if not turned-off
# sendfile off;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
}
}

## FRONTEND ##
server {
Expand All @@ -35,7 +6,7 @@ server {
root /app/frontend/web;
index index.php index.html;

server_name yii2-starter-kit.localhost localhost;
server_name localhost;

charset utf-8;

Expand Down Expand Up @@ -74,77 +45,8 @@ server {
}
}

## BACKEND ##
server {
listen 80;

root /app/backend/web;
index index.php index.html;

server_name backend.yii2-starter-kit.localhost;

charset utf-8;

client_max_body_size 16m;

# There is a VirtualBox bug related to sendfile that can lead to
# corrupted files, if not turned-off on Vagrant based setup
# sendfile off;

location / {
try_files $uri $uri/ /index.php?$args;
}

# location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
# access_log off;
# expires max;
# }

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
}

}

## STORAGE ##
server {
listen 80;
server_name storage.yii2-starter-kit.localhost;

root /app/storage/web;
index index.html;
# expires max;

# There is a VirtualBox bug related to sendfile that can lead to
# corrupted files, if not turned-off
# sendfile off;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
}
}

## PHP-FPM Servers ##
upstream php-fpm {
server app:9000;
}

## MISC ##
### WWW Redirect ###
server {
listen 80;
server_name www.yii2-starter-kit.localhost;
return 301 http://yii2-starter-kit.localhost$request_uri;
}

0 comments on commit f50bd7e

Please sign in to comment.