File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .idea
12/logs
23/data
3- .env
4+ .env
Original file line number Diff line number Diff line change @@ -203,6 +203,17 @@ services:
203203 volumes :
204204 - ../:/var/www/laravel
205205
206+ # By default, site_a and site_b are mirroring the parent Laravel app.
207+ # This is because the nginx container has these domains
208+ # enabled to demonstrate how to support multiple sites
209+ - ../:/var/www/site_a
210+ - ../:/var/www/site_b
211+
212+ # This demonstrates example of where you may mount sites
213+ # - ../../site_a/:/var/www/site_a
214+ # - ../../site_b/:/var/www/site_b
215+
216+
206217# ## Databases Data Container ################################
207218
208219 volumes_data :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ FROM nginx:alpine
33MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
44
55ADD nginx.conf /etc/nginx/
6- ADD laravel .conf /etc/nginx/conf.d/laravel.conf
6+ COPY sites/* .conf /etc/nginx/sites-available/
77
88ARG PHP_UPSTREAM=php-fpm
99
Original file line number Diff line number Diff line change 2424 gzip on;
2525 gzip_disable "msie6" ;
2626 include /etc/nginx/conf.d/*.conf;
27+ include /etc/nginx/sites-available/*;
2728 open_file_cache max=100 ;
2829}
Original file line number Diff line number Diff line change 11server {
2+
23 listen 80 default_server;
34 listen [::]:80 default_server ipv6only=on;
45
6+ server_name laravel;
57 root /var/www/laravel/public;
68 index index.php index.html index.htm;
79
Original file line number Diff line number Diff line change 1+ server {
2+
3+ listen 80;
4+ listen [::]:80;
5+
6+ server_name site_a;
7+ root /var/www/site_a/public;
8+ index index.php index.html index.htm;
9+
10+ location / {
11+ try_files $uri $uri/ /index.php$is_args$args;
12+ }
13+
14+ location ~ \.php$ {
15+ try_files $uri /index.php =404;
16+ fastcgi_pass php-upstream;
17+ fastcgi_index index.php;
18+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19+ include fastcgi_params;
20+ }
21+
22+ location ~ /\.ht {
23+ deny all;
24+ }
25+ }
26+
27+
28+
Original file line number Diff line number Diff line change 1+ server {
2+
3+ listen 80;
4+ listen [::]:80;
5+
6+ server_name site_b;
7+ root /var/www/site_b/public;
8+ index index.php index.html index.htm;
9+
10+ location / {
11+ try_files $uri $uri/ /index.php$is_args$args;
12+ }
13+
14+ location ~ \.php$ {
15+ try_files $uri /index.php =404;
16+ fastcgi_pass php-upstream;
17+ fastcgi_index index.php;
18+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19+ include fastcgi_params;
20+ }
21+
22+ location ~ /\.ht {
23+ deny all;
24+ }
25+ }
26+
27+
28+
You can’t perform that action at this time.
0 commit comments