Welcome! Log In Create A New Profile

Advanced

migration from Apache

Posted by ewok2 
migration from Apache
September 22, 2018 12:12PM
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
Re: migration from Apache
September 29, 2018 06:16AM
Hello

I think I know why it does not work.
I am trying to use exemple of configuring 2 site like "myadress1.com" and "myadress2.com"
But in fact I need to configure "test1.myadress.com" and "test2.myadress.com"

But I don't see exemple of this configuration...
Do anyone has an exemple of how to send :
test1.myadress.com => on localhost : /var/www/test1.myadress.com
and
test2.myadress.com => on another local IP host : /var/www/test2.myadress.com

thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready