Updated Nginx (markdown)

d47081 2023-12-01 15:52:21 +02:00
parent 3af4de11fb
commit 4ef1b7b758

@ -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;