nginx sites-available and sites-enable

I'm the same as you new to FreeBSD but its fun to learn these things :) This helped me alot maybe this has some use to you https://www.digitalocean.com/commun...wordpress-with-nginx-on-a-freebsd-10-1-server and http://www.cyberciti.biz/faq/freebsd-nginx-namebased-virtual-hosting-configuration/ .
Thanks Vincent. Sorry for late responds. I was up till 5 am last night trying to figure out and read lots of tutorials including yours. Somehow I was able to display my first basic page but not they way i wanted it.
Here is what i am trying to do. I have done this in linux but i want to learn how to do it on freebsd and i like freebsd because it challenges me.
On freebsd machine (home's network)I would like to have nextcloud and joomla but they way I want is like this https://nextcloud and https://joomla . i dont want like this https://joomla/nextcloud is that possible or am I stuck with this https://joomla/nextcloud since i dont have fqdn.
i use ddns to access my owncloud from outside and i use openvpn too. I did it with linux now i want to switch to freebsd. I am like you it is fun to learn freebsd and i like freebsd too.
 
Thanks Vincent. Sorry for late responds. I was up till 5 am last night trying to figure out and read lots of tutorials including yours. Somehow I was able to display my first basic page but not they way i wanted it.
Here is what i am trying to do. I have done this in linux but i want to learn how to do it on freebsd and i like freebsd because it challenges me.
On freebsd machine (home's network)I would like to have nextcloud and joomla but they way I want is like this https://nextcloud and https://joomla . i dont want like this https://joomla/nextcloud is that possible or am I stuck with this https://joomla/nextcloud since i dont have fqdn.
i use ddns to access my owncloud from outside and i use openvpn too. I did it with linux now i want to switch to freebsd. I am like you it is fun to learn freebsd and i like freebsd too.
Hi Ependi Silalahi, I just finished fixing my bacula, honestly I want to do something the same as yours as you describe, I will test nginx now and update you what I find. :) I just read somewhere (I couldn't remember where) but I think you need an additional virtual IP setup. Example, if you have one computer that has an IP address of 192.168.1.140 and it has https://nextcloud on it, you cannot have another website on that same IP. So what you do is create another virtual IP from the same computer that outputs 192.168.1.141 and have https://joomla on it. I will search that up. :)
 
Thanks Vincent. Sorry for late responds. I was up till 5 am last night trying to figure out and read lots of tutorials including yours. Somehow I was able to display my first basic page but not they way i wanted it.
Here is what i am trying to do. I have done this in linux but i want to learn how to do it on freebsd and i like freebsd because it challenges me.
On freebsd machine (home's network)I would like to have nextcloud and joomla but they way I want is like this https://nextcloud and https://joomla . i dont want like this https://joomla/nextcloud is that possible or am I stuck with this https://joomla/nextcloud since i dont have fqdn.
i use ddns to access my owncloud from outside and i use openvpn too. I did it with linux now i want to switch to freebsd. I am like you it is fun to learn freebsd and i like freebsd too.
I think this explains why sites available and sites enable are not available in FreeBSD nginx. https://forums.freebsd.org/threads/42444/
 
Hi Ependi Silalahi, I just finished fixing my bacula, honestly I want to do something the same as yours as you describe, I will test nginx now and update you what I find. :) I just read somewhere (I couldn't remember where) but I think you need an additional virtual IP setup. Example, if you have one computer that has an IP address of 192.168.1.140 and it has https://nextcloud on it, you cannot have another website on that same IP. So what you do is create another virtual IP from the same computer that outputs 192.168.1.141 and have https://joomla on it. I will search that up. :)
Vincent I was able to make something different and still using from the same machine
My freebsd webserver is 192.168.10.30
I can go to chicago.com and miami.com both display different page because I have "include /var/www/vhosts/*.conf
also i have /var/www/chicago.com/index.html and /var/www/miami.com/index.html
then i use /etc/hosts like this
192.168.10.30 miami.com www.miami.com
192.168.10.30 chicago.com www.chicago.com
when type jakarta.com on my local pc it will go index.html of jakarta but if i type http://localhost or 192.168.10.30 it it will go to default nginx first page and I dont know how to turn off the nginx default first page. do you?
 
Go into /usr/local/etc/nginx/. There is where your directories all are except the default HTML files which are in /usr/local/www/nginx/.

In /usr/local/etc/nginx/nginx.conf, you will find

Code:
location / {
    root /usr/local/www/nginx;
    index index.html;
}

In there should be a configuration for root of your server and that should be pointing to /usr/local/www/nginx/ where the default index.html page is. You need to change the path to the root directory for your server where your index page is.
 
Go into /usr/local/etc/nginx/. There is where your directories all are except the default HTML files which are in /usr/local/www/nginx/.

In /usr/local/etc/nginx/nginx.conf, you will find

Code:
location / {
    root /usr/local/www/nginx;
    index index.html;
}

In there should be a configuration for root of your server and that should be pointing to /usr/local/www/nginx/ where the default index.html page is. You need to change the path to the root directory for your server where your index page is.
thanks for helping us out
When I compiled nginx there was no nginx.conf but I see nginx-con-dist but in i see linux conf.d overwrite .conf what is in freebsd?
 
I've never heard of those exact filenames before. I don't know how nginx runs without nginx.conf. iirc, nginx.conf-dist is the default config file. Just copy nginx.conf-dist to nginx.conf and edit that one.
 
I've never heard of those exact filenames before. I don't know how nginx runs without nginx.conf. iirc, nginx.conf-dist is the default config file. Just copy nginx.conf-dist to nginx.conf and edit that one.
Thats what I thought when I read the nginx.nginx-dist it look like nginx.conf only need to uncoment '#"
Like in linux the conf.d overwrite *.conf what do they have similaties in freebsd or it doesnt exist?
 
As I said earlier, nginx was always developed on FreeBSD. Anything missing would be in the Linux version and the only reason they just now started developing on Linux cause Linux has different problems than the rest of the world. But it should work the same overall. For FreeBSD you do want use kqueue instead of the Linux thing (can't think of it). You also want sendfile on.

At the start everything else should work fine but, as you get more comfortable, there are things you can tune. Look at https://calomel.org/nginx.html for some ideas.
 
Back
Top