I host several small sites on a VPS using Nginx to proxy the domain to correct site. As I am using Go, there is a built in web server that allows me to make the routing very simple (two proxied site in this example):
“`
server {
server_name go4webdev.org www.go4webdev.org;
location / {
proxy_pass http://localhost:9090;
}
}
server {
server_name static.go4webdev.org;
location / {
proxy_pass http://localhost:9091;
}
}
Now I am trying to add a Flarum Forum to this setting in Nginx. As Flarum is built with PHP, this setting in Nginx redirects me to the main domain instead:
“`
server {
server_name forum.go4webdev.org;
root /var/www/flarum/public;
index index.php;
listen localhost:443;
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /. {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
allow all;
}
}
As PHP not is my native language, I am completely lost. Any clue is welcome.