add symfony, laravel and app nginx sites sampels

This commit is contained in:
Mahmoud Zalt 2017-08-01 22:12:43 +03:00
parent d32cfb31b1
commit c836500488
5 changed files with 48 additions and 6 deletions

View File

@ -1021,9 +1021,16 @@ To install CodeIgniter 3 on Laradock all you have to do is the following simple
3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. 3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.
<a name="Install-Symfony"></a>
## Install Symfony
The installation is very simple, nothing special.
The NGINX sites include a default config file for your Symfony project `symfony.conf.example`, so edit it and make sure the `root` is pointing to your project web directory.
You mihgt to run `docker-compose restart` if the container are already running.
Visit `symfony.dev`
<br> <br>
<a name="Misc"></a> <a name="Misc"></a>

View File

@ -112,9 +112,9 @@ Your folder structure should look like this:
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains. 2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples. Laradock by default includes `app.conf.example`, `laravel.conf.example` and `symfony.conf.example` as working samples.
3 - change the default names `project-n`: 3 - change the default names `*.conf`:
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name. You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
@ -123,6 +123,7 @@ You can rename the config files, project folders and domains as you like, just m
``` ```
127.0.0.1 project-1.dev 127.0.0.1 project-1.dev
127.0.0.1 project-2.dev 127.0.0.1 project-2.dev
...
``` ```
> **Now jump to the [Usage](#Usage) section.** > **Now jump to the [Usage](#Usage) section.**

View File

@ -3,8 +3,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name project-1.dev; server_name app.dev;
root /var/www/project-1/public; root /var/www/app;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -29,4 +29,7 @@ server {
root /var/www/letsencrypt/; root /var/www/letsencrypt/;
log_not_found off; log_not_found off;
} }
error_log /var/log/nginx/app_error.log;
access_log /var/log/nginx/app_access.log;
} }

View File

@ -3,8 +3,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name project-2.dev; server_name laravel.dev;
root /var/www/project-2/public; root /var/www/laravel/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -29,4 +29,7 @@ server {
root /var/www/letsencrypt/; root /var/www/letsencrypt/;
log_not_found off; log_not_found off;
} }
error_log /var/log/nginx/laravel_error.log;
access_log /var/log/nginx/laravel_access.log;
} }

View File

@ -0,0 +1,28 @@
server {
listen 80;
listen [::]:80;
server_name symfony.dev;
root /var/www/projects/symfony/web;
index index.php index.html index.htm;
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
error_log /var/log/nginx/symfony_error.log;
access_log /var/log/nginx/symfony_access.log;
}