adding new configuration for http testing
This commit is contained in:
+3
-1
@@ -7,4 +7,6 @@ deploy.sh
|
|||||||
_deploy
|
_deploy
|
||||||
/public/build
|
/public/build
|
||||||
/public/abitur
|
/public/abitur
|
||||||
/public/sveden
|
/public/sveden
|
||||||
|
dump.sql
|
||||||
|
.idea
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
server {
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_disable "msie6"; # Отключение для IE6 (устаревший браузер)
|
||||||
|
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||||
|
|
||||||
|
gzip_min_length 1024;
|
||||||
|
|
||||||
|
gzip_comp_level 6;
|
||||||
|
|
||||||
|
gzip_buffers 16 8k;
|
||||||
|
|
||||||
|
gzip_proxied any;
|
||||||
|
|
||||||
|
gzip_vary on;
|
||||||
|
|
||||||
|
client_max_body_size 200M; # Максимальный размер тела запроса
|
||||||
|
large_client_header_buffers 4 128k; # Размеры буферов для заголовков
|
||||||
|
|
||||||
|
root /var/www/public;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
add_header Access-Control-Allow-Origin *; # Заголовок для CORS
|
||||||
|
try_files $uri /index.php?$args; # Обработка запросов
|
||||||
|
}
|
||||||
|
|
||||||
|
location /sveden/ {
|
||||||
|
alias /var/www/public/sveden/;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /sveden/index.html;
|
||||||
|
expires epoch;
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /sveden {
|
||||||
|
return 301 /sveden/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /abitur/ {
|
||||||
|
alias /var/www/public/abitur/;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /abitur/index.html;
|
||||||
|
expires epoch;
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /abitur {
|
||||||
|
return 301 /abitur/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404; # Если файл не найден, возвращаем 404
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$; # Разделение пути
|
||||||
|
fastcgi_pass app:9000; # Указываем сервер PHP-FPM
|
||||||
|
fastcgi_index index.php; # Индексный файл
|
||||||
|
include fastcgi_params; # Включаем параметры FastCGI
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Путь к скрипту
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info; # Информация о пути
|
||||||
|
fastcgi_buffers 16 16k; # Увеличение буферов FastCGI
|
||||||
|
fastcgi_buffer_size 32k; # Размер буфера FastCGI
|
||||||
|
}
|
||||||
|
|
||||||
|
# Защита от доступа к конфиденциальным файлам
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all; # Запрет доступа к файлам .htaccess
|
||||||
|
}
|
||||||
|
|
||||||
|
# Настройки кэширования для статических файлов
|
||||||
|
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|otf)$ {
|
||||||
|
expires 30d; # Кэширование на 30 дней
|
||||||
|
add_header Cache-Control "public, no-transform"; # Заголовок кэширования
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ class ForceHttpsServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
if ($this->app->environment('production')) {
|
if (env('NGINX_ENV') === 'prod') {
|
||||||
URL::forceScheme('https');
|
URL::forceScheme('https');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
webserver:
|
webserver:
|
||||||
image: nginx:1.27.2
|
image: nginx:1.27.2
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
|
||||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
@if (env('NGINX_ENV') === 'prod')
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||||
|
@endif
|
||||||
{{-- <title inertia>{{ config('app.name', 'Laravel') }}</title>--}}
|
{{-- <title inertia>{{ config('app.name', 'Laravel') }}</title>--}}
|
||||||
|
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
|
|||||||
Reference in New Issue
Block a user