From 4ef1b7b75832f4c86412fcf5d660eb21805388cf Mon Sep 17 00:00:00 2001 From: d47081 <108541346+d47081@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:52:21 +0200 Subject: [PATCH] Updated Nginx (markdown) --- Nginx.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/Nginx.md b/Nginx.md index cbf772d..e3034d7 100644 --- a/Nginx.md +++ b/Nginx.md @@ -4,6 +4,67 @@ Follow official Symfony docs https://symfony.com/doc/current/setup/web_server_configuration.html +## Domain location + +URL example: + +`http://tracker.ygg` + +App sources: + +`/var/www/YGGverse/YGGtracker` + +Web root: + +`/var/www/html` + +Symlink: + +`ln -s /var/www/YGGverse/YGGtracker/public /var/www/html/yggtracker` + +Config: + +``` +server { + + listen [::]:80; + + allow 0200::/7; + deny all; + + root /var/www/YGGverse/YGGtracker/public; + + index index.html index.htm index.nginx-debian.html index.php; + + server_name tracker.ygg; + + location / { + + try_files $uri /index.php$is_args$args; + } + + location ~ ^/index\.php(/|$) { + + fastcgi_param APP_ENV prod; + + include snippets/fastcgi-php.conf; + + fastcgi_pass unix:/run/php/php8.1-fpm.sock; + + fastcgi_split_path_info ^(.+\.php)(/.*)$; + + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + + internal; + } + + location ~ \.php$ { + return 404; + } +} +``` + ## Sub-directory location URL example: @@ -31,8 +92,8 @@ server { listen [::]:80 default; # Yggdrasil-only connections - # allow 0200::/7; - # deny all; + allow 0200::/7; + deny all; root /var/www/html; @@ -52,7 +113,6 @@ server { location @yggtracker { - # Provide actual php -v fastcgi_pass unix:/run/php/php8.1-fpm.sock; include fastcgi_params;