Hello
I am new in nginx.
I had a apache web server and I am trying to migrate to nginx.
I have follow the tuto from DigitalOcean but some point are still not working...
My conf :
2 Ubuntu 18.04 running on virtual Machine (ESXI)
The first one "vm1" receive all the traffic from pfsense when it is on port 80.
Both "vm1" and "vm2" have web services.
"vm1" : the main web site + one imagevuex web site.
"vm2" : cacti web interface
I have put 3 files in the "/etc/nginx/sites-available" and the 3 link in the site-enable.
The 2 files (site1.mydomaine.net ; site2.mydomaine.net ; site3.mydomaine.net) are like this :
-------------------------------------------------------------------------------------------------
server {
listen 80;
root /var/www/site1.mydomaine.net;
index index.php index.html index.htm index.nginx-debian.html;
server_name site1.mydomaine.net;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
-------------------------------------------------------------------------------------------------
The 3rd file (site3.mydomaine.net) is like this :
-------------------------------------------------------------------------------------------------
server {
listen 80;
server_name site3.mydomaine.net;
index index.php index.html index.htm index.nginx-debian.html;
location / {
proxy_pass http://localIP/cacti/;
proxy_set_header Host $host;
try_files $uri $uri/ =404;
}
location ~ /\.ht {
deny all;
}
}
-------------------------------------------------------------------------------------------------
Now the state of today :
Site1 is working
Site2 and 3 are partially working :
=> When I put site2.mydomaine.net or site3.mydomaine.net in firefox, The index.php work but when "leave" the initial page I get a 404! like if the path was not good.
Any idea ?
Thanks