Hello Mansoor, I didn't get why we are using the nginx? And I created simple html page host it through flask app and it working. So my query why we are using nginx. Thanks.
That's a good question. I guess I should have explained it better in the video. The idea is that nginx with a static website is the simplest form of a webserver/website and is the founding block of any more complicated web application. Nginx is widely used as a static server, reverse proxy, load balancer etc and is Very useful to understand those concepts, which we will go through in upcoming videos
Hello masoor, I created new file in /etc/nginx/sites-enabled/ Name escap3.com and edit it with mentioned details. And created index.html in /var/www/escap3.com/ Then restarting the nginx service but it fails. Telling invalid number of arguments in "root" directive in /etc/nginx/sites-enabled/escap3.com But I follow the same steps mentioned by you for editing. Thanks Devendra
@@esc-sh devd@debian:/home/devd:cat /etc/nginx/sites-enabled/escap3.com ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # www.nginx.com/resources/wiki/start/ # www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80; #listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /var/www/escap3.com # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name escap3.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/run/php/php7.3-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #}
@@esc-sh bro, I got it now nginx working now. And now im able to get custom page for nginx. Thank you bro, Googling nginx conf and other details. 🙏 Thank you
Great work man! Very appreciated :D any chance that you keep posting new stuff?
Life got busy, but I do have plans to come back:)
Great content Mansoor, very helpful for the beginners in devops world :)
Appreciated 😊
Hello Mansoor,
I didn't get why we are using the nginx?
And I created simple html page host it through flask app and it working. So my query why we are using nginx.
Thanks.
That's a good question. I guess I should have explained it better in the video. The idea is that nginx with a static website is the simplest form of a webserver/website and is the founding block of any more complicated web application.
Nginx is widely used as a static server, reverse proxy, load balancer etc and is Very useful to understand those concepts, which we will go through in upcoming videos
Hi Bro awesome tutorials, everyday am learning devops from your videos, need help how can i set-up Debian server on ubuntu
Hi Praveen,
Glad you’re learning a lot
What do you mean by debian server on ubuntu?
@@esc-sh Thanks for your reply, how can i create server on ubuntu for practicing because i have ubuntu OS
You can install virtualbox and follow the instructions on video 1
Oh ok thank you
Hello masoor,
I created new file in /etc/nginx/sites-enabled/
Name escap3.com and edit it with mentioned details.
And created index.html in /var/www/escap3.com/
Then restarting the nginx service but it fails.
Telling invalid number of arguments in "root" directive in /etc/nginx/sites-enabled/escap3.com
But I follow the same steps mentioned by you for editing.
Thanks Devendra
Can you post the full config?
@@esc-sh devd@debian:/home/devd:cat /etc/nginx/sites-enabled/escap3.com
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# www.nginx.com/resources/wiki/start/
# www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80;
#listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/escap3.com
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name escap3.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.3-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
@@esc-sh bro, I got it now nginx working now.
And now im able to get custom page for nginx.
Thank you bro,
Googling nginx conf and other details.
🙏 Thank you
Awesome