forked from eatvio/eatvio-infra
84 lines
2.3 KiB
Nginx Configuration File
Executable File
84 lines
2.3 KiB
Nginx Configuration File
Executable File
upstream phpupstream {
|
||
server php-fpm:9000 fail_timeout=5s max_fails=5;
|
||
}
|
||
|
||
resolver 127.0.0.11 ipv6=off;
|
||
|
||
map $http_upgrade $connection_upgrade {
|
||
default upgrade;
|
||
'' close;
|
||
}
|
||
|
||
# 1. Основной сайт (Laravel) - делаем его default_server
|
||
server {
|
||
listen 80 default_server; # Добавили default_server
|
||
server_name testing.eatv.io;
|
||
|
||
client_max_body_size 108M;
|
||
rewrite_log on;
|
||
|
||
access_log /dev/stdout;
|
||
error_log /dev/stdout info;
|
||
|
||
root /application/public;
|
||
index index.php;
|
||
|
||
# # Vite HMR
|
||
# location /_vite {
|
||
# proxy_pass http://frontend:5173;
|
||
# proxy_http_version 1.1;
|
||
# proxy_set_header Upgrade $http_upgrade;
|
||
# proxy_set_header Connection $connection_upgrade;
|
||
# proxy_set_header Host $host;
|
||
# proxy_set_header X-Real-IP $remote_addr;
|
||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
# proxy_set_header X-Forwarded-Proto $scheme;
|
||
# proxy_connect_timeout 7d;
|
||
# proxy_send_timeout 7d;
|
||
# proxy_read_timeout 7d;
|
||
# }
|
||
#
|
||
# location /build {
|
||
# try_files $uri $uri/ =404;
|
||
# expires 1y;
|
||
# add_header Cache-Control "public, immutable";
|
||
# }
|
||
|
||
location / {
|
||
try_files $uri /index.php$is_args$args;
|
||
}
|
||
|
||
location ~ \.php$ {
|
||
fastcgi_pass phpupstream;
|
||
fastcgi_index index.php;
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
|
||
fastcgi_buffers 16 16k;
|
||
fastcgi_buffer_size 32k;
|
||
include fastcgi_params;
|
||
}
|
||
}
|
||
|
||
# 2. Soketi - меняем server_name на тот, что в traefik labels (wstesting.eatv.io)
|
||
server {
|
||
listen 80;
|
||
server_name wstesting.eatv.io; # ВАЖНО: Используем поддомен для сокетов
|
||
|
||
location / {
|
||
proxy_pass http://soketi:6001;
|
||
proxy_read_timeout 60;
|
||
proxy_connect_timeout 60;
|
||
proxy_redirect off;
|
||
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection 'upgrade';
|
||
proxy_set_header Host $host;
|
||
proxy_cache_bypass $http_upgrade;
|
||
}
|
||
|
||
error_log /dev/stdout info;
|
||
access_log /dev/stdout;
|
||
}
|
||
|