Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet474/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   470   471   472   473   474   475   476   477   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 369 
]
At this point, assuming that you have the required content in 
/var/www/acmesales.com
 
and have a proper configuration file, the new site should respond as soon as you 
reload 
nginx
. But what about TLS? I recommend we always secure our websites
regardless of which solution we're using to serve it. With NGINX, we can add that 
feature easily. The certificate files themselves are the same regardless of whether 
we're using Apache or NGINX. If you haven't already created your certificate files
refer back to the section in this chapter where we did so. Assuming you already have 
certificate files, we just need to make additional changes to our configuration.
First, we change the first two lines to listen on port 
443
 with TLS instead of standard 
port 
80
:
listen 443 ssl; 
listen [::]:443 ssl; 
Next, we'll add the following two lines before the 
location
 section:
ssl_certificate /etc/certs/cert.pem; 
ssl_certificate_key /etc/certs/cert.key; 
ssl_session_timeout 5m; 
For this to work, you'll need to adjust the paths and the names of the 
cert
 files to 
make sure they
 match what you called them on your server. The entire file should 
look similar to the following at this point:
server { 
        listen 443 ssl; 
        listen [::]:443 ssl; 
 
        root /var/www/html; 
 
        index index.html index.htm index.nginx-debian.html; 
 
        server_name acmesales.com www.acmesales.com; 
 
         ssl_certificate /etc/certs/cert.pem; 
         ssl_certificate_key /etc/certs/cert.key; 
         ssl_session_timeout 5m; 
        location / { 
                try_files $uri $uri/ =404; 
        } 



Serving Web Content

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   470   471   472   473   474   475   476   477   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish