-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
echo "Привет, Otus!<br>".date("Y-m-d H:i:s") ."<br><br>"; | ||
Check failure on line 3 in code/index.php GitHub Actions / phpcs
Check failure on line 3 in code/index.php GitHub Actions / phpcs
|
||
|
||
echo "Что-то еще 22"; | ||
|
||
phpinfo(); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM nginx:latest | ||
|
||
COPY ./hosts/mysite.local.conf /etc/nginx/conf.d/mysite.local.conf | ||
|
||
WORKDIR /data | ||
|
||
#Примонтированые данные из хостовой ОС - двунаправленная директория | ||
VOLUME /data | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
server { | ||
# указываем 80 порт для соединения | ||
listen 80; | ||
# нужно указать, какому доменному имени принадлежит наш конфиг | ||
server_name mysite.local; | ||
|
||
# задаём корневую директорию | ||
root /data/mysite.local; | ||
|
||
# стартовый файл | ||
index index.php index.html; | ||
|
||
# при обращении к статическим файлам логи не нужны, равно как и обращение к fpm | ||
# http://mysite.local/static/some.png | ||
location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ { | ||
access_log off; | ||
expires max; | ||
} | ||
|
||
# помним про единую точку доступа | ||
# все запросы заворачиваются в корневую директорию root на index.php | ||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
|
||
# и наконец правило обращения к php-fpm | ||
location ~* .php$ { | ||
try_files $uri = 404; | ||
fastcgi_split_path_info ^(.+.php)(/.+)$; | ||
fastcgi_pass app:9000; | ||
#fastcgi_pass unix:/var/run/php-fpm.sock; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |