Skip to content

Commit 500595d

Browse files
committed
Added support for multiple nginx vhosts.
1 parent b004c34 commit 500595d

File tree

6 files changed

+36
-29
lines changed

6 files changed

+36
-29
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
server {
2+
listen 80;
3+
root /var/www/public;
4+
index index.php;
5+
6+
location / {
7+
# Pretty URLs for Laravel.
8+
try_files $uri $uri/ /index.php?$args;
9+
}
10+
11+
location ~ \.php$ {
12+
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
13+
if (!-f $document_root$fastcgi_script_name) {
14+
return 404;
15+
}
16+
17+
include fastcgi_params;
18+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19+
fastcgi_param PATH_INFO $fastcgi_path_info;
20+
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
21+
22+
fastcgi_pass localhost:9000;
23+
fastcgi_index index.php;
24+
}
25+
26+
# set client body size to 30M
27+
client_max_body_size 30M;
28+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

dist/mariadb/docker/docker-compose.base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
links:
99
- db
1010
volumes:
11+
- ./web:/etc/nginx/custom
1112
- ..:/var/www
1213

1314
db:

dist/postgres/docker/docker-compose.base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
links:
99
- db
1010
volumes:
11+
- ./web:/etc/nginx/custom
1112
- ..:/var/www
1213

1314
db:

web/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ RUN apt-get update && \
1515
apt-get remove -y && \
1616
apt-get autoremove -y && \
1717
apt-get clean && \
18-
rm -rf /var/lib/apt/lists/*
18+
rm -rf /var/lib/apt/lists/* && \
19+
mkdir /etc/nginx/custom
1920

2021
ADD supervisor/php-fpm.conf /etc/supervisor/conf.d/php-fpm.conf
2122
ADD supervisor/nginx.conf /etc/supervisor/conf.d/nginx.conf
@@ -26,3 +27,4 @@ ADD entrypoint.sh /usr/local/bin/entrypoint-web.sh
2627
WORKDIR /var/www
2728

2829
ENTRYPOINT ["/usr/local/bin/entrypoint-web.sh"]
30+

web/nginx.conf

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1 @@
1-
server {
2-
listen 80;
3-
root /var/www/public;
4-
index index.php;
5-
6-
location / {
7-
# Pretty URLs for Laravel.
8-
try_files $uri $uri/ /index.php?$args;
9-
}
10-
11-
location ~ \.php$ {
12-
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
13-
if (!-f $document_root$fastcgi_script_name) {
14-
return 404;
15-
}
16-
17-
include fastcgi_params;
18-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19-
fastcgi_param PATH_INFO $fastcgi_path_info;
20-
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
21-
22-
fastcgi_pass localhost:9000;
23-
fastcgi_index index.php;
24-
}
25-
26-
# set client body size to 30M
27-
client_max_body_size 30M;
28-
}
1+
include /etc/nginx/custom/sites/*.conf;

0 commit comments

Comments
 (0)