Skip to content

Commit

Permalink
Merge pull request #521 from edersoares/nginx-upstream
Browse files Browse the repository at this point in the history
Nginx upstream
  • Loading branch information
edersoares committed Mar 11, 2019
2 parents 5240f27 + 4f2e5ea commit 3c79f19
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ services:
- php
ports:
- 80
working_dir: /application
working_dir: /var/www/ieducar
volumes:
- ./:/application
- ./:/var/www/ieducar

php:
container_name: ieducar-php
Expand All @@ -26,9 +26,9 @@ services:
XDEBUG_REMOTE_PORT: 9000
XDEBUG_REMOTE_ENABLE: 0
XDEBUG_AUTOSTART: 0
working_dir: /application
working_dir: /var/www/ieducar
volumes:
- ./:/application
- ./:/var/www/ieducar

postgres:
container_name: ieducar-postgres
Expand Down
1 change: 1 addition & 0 deletions docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ MAINTAINER Eder Soares
RUN apt-get update -y

COPY default.conf /etc/nginx/conf.d/default.conf
COPY upstream.conf /etc/nginx/conf.d/upstream.conf
19 changes: 8 additions & 11 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
server {

listen 80;

server_name default_server;

root /var/www/ieducar/public;
index index.php index.html;
server_name _;

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /application/public;

location ~ ^/intranet/?$ {
rewrite ^.*$ /intranet/index.php redirect;
Expand All @@ -27,19 +31,12 @@ server {
}

location ~ ^(/intranet.*\.php|/modules.*\.php|/module/) {
try_files /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
rewrite ^(.*)$ /index.php$1;
}

location ~ \.php {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Expand Down
3 changes: 3 additions & 0 deletions docker/nginx/upstream.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upstream php-fpm {
server php:9000;
}
2 changes: 1 addition & 1 deletion docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN docker-php-ext-install zip

RUN apt-get install -y unzip

RUN ln -s /application/artisan /usr/local/bin/artisan
RUN ln -s /var/www/ieducar/artisan /usr/local/bin/artisan

RUN mkdir -p /usr/share/man/man7
RUN apt-get install -y postgresql-client
Expand Down
2 changes: 1 addition & 1 deletion ieducar/configuration/ieducar.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ report.show_error_details = true
report.default_factory = Portabilis_Report_ReportFactoryPHPJasper

; Define o diretório dos arquivos fontes dos relatórios
report.source_path = /application/ieducar/modules/Reports/ReportSources/
report.source_path = /var/www/ieducar/ieducar/modules/Reports/ReportSources/

; Configurações usadas pelo modulo de tratamento de erros ocorridos na aplicação.
modules.error.link_to_support = https://forum.ieducar.org/
Expand Down

0 comments on commit 3c79f19

Please sign in to comment.