Nginx Β· Active

Deep Forest

ВСстовая страница Nginx. Π‘Π΅Ρ€Π²Π΅Ρ€ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ ΠΊΠΎΡ€Ρ€Π΅ΠΊΡ‚Π½ΠΎ β€” Π΄ΠΎΠΌΠ΅Π½ настроСн, Π²ΠΈΡ€Ρ‚ΡƒΠ°Π»ΡŒΠ½Ρ‹ΠΉ хост ΠΎΡ‚Π²Π΅Ρ‡Π°Π΅Ρ‚. Π”ΠΎΠ±Ρ€ΠΎ ΠΏΠΎΠΆΠ°Π»ΠΎΠ²Π°Ρ‚ΡŒ Π² лСс.

⚑ Бтатус сСрвСра πŸ“„ ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ
Scroll

Nginx Β· Π‘Π΅Ρ€Π²Π΅Ρ€

Всё Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚

🌐
HTTP / HTTPS
Π‘Π΅Ρ€Π²Π΅Ρ€ ΡΠ»ΡƒΡˆΠ°Π΅Ρ‚ ΠΏΠΎΡ€Ρ‚Ρ‹ 80 ΠΈ 443. SSL-тСрминация Ρ‡Π΅Ρ€Π΅Π· Let's Encrypt. Π Π΅Π΄ΠΈΡ€Π΅ΠΊΡ‚ HTTP β†’ HTTPS Π°ΠΊΡ‚ΠΈΠ²Π΅Π½.
⚑
ΠŸΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ
Worker processes: auto (ΠΏΠΎ числу ядСр). Keepalive timeout: 65 с. Gzip сТатиС Π²ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΎ.
πŸ›‘οΈ
Π‘Π΅Π·ΠΎΠΏΠ°ΡΠ½ΠΎΡΡ‚ΡŒ
X-Frame-Options, X-Content-Type-Options, HSTS. Server tokens ΠΎΡ‚ΠΊΠ»ΡŽΡ‡Π΅Π½Ρ‹. ΠšΠ»ΠΈΠ΅Π½Ρ‚ΡΠΊΠΈΠ΅ Π±ΡƒΡ„Π΅Ρ€Ρ‹ ΠΎΠ³Ρ€Π°Π½ΠΈΡ‡Π΅Π½Ρ‹.
πŸ“
Static files
Root: /var/www/html. Expires для ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ β€” 30 Π΄Π½Π΅ΠΉ. Index-Ρ„Π°ΠΉΠ»: index.html.
--:--:--
Π›ΠΎΠΊΠ°Π»ΡŒΠ½ΠΎΠ΅ врСмя
00:00
ВрСмя Π½Π° страницС
TERMINAL
user@devops-lab: ~
$nginx -v
nginx version: nginx/1.24.0 (Ubuntu)
$sudo nginx -t
βœ“nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
βœ“nginx: configuration file /etc/nginx/nginx.conf test is successful
$sudo systemctl status nginx
●nginx.service - A high performance web server
   Loaded:loaded (/lib/systemd/system/nginx.service; enabled)
   Active:active (running)since boot
$curl -I http://localhost
HTTP/1.1200 OK
Server:nginx/1.24.0
Content-Type:text/html; charset=UTF-8
X-Frame-Options:SAMEORIGIN
Cache-Control:max-age=2592000
$ls /etc/nginx/sites-enabled/
default  forest.example.com
$# 🌿 Всё Π³ΠΎΡ‚ΠΎΠ²ΠΎ ΠΊ Ρ€Π°Π±ΠΎΡ‚Π΅!
$_

Gallery

ЛСсныС ΠΌΠΎΡ‚ΠΈΠ²Ρ‹

Deep Forest
Fern
Maple leaf
Morning Mist
Mushroom
Pine

Nginx

ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ Π²ΠΈΡ€Ρ‚ΡƒΠ°Π»ΡŒΠ½ΠΎΠ³ΠΎ хоста

/etc/nginx/sites-available/forest
/etc/nginx/nginx.conf
# Virtual host β€” forest.example.com
server {
  listen     80;
  server_name forest.example.com www.forest.example.com;
  return     301 https://$host$request_uri;
}

server {
  listen     443 ssl http2;
  server_name forest.example.com www.forest.example.com;

  # SSL
  ssl_certificate     /etc/letsencrypt/live/forest.example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/forest.example.com/privkey.pem;
  ssl_protocols       TLSv1.2 TLSv1.3;
  ssl_ciphers         HIGH:!aNULL:!MD5;

  # Root
  root    /var/www/forest;
  index   index.html;

  # Security headers
  add_header X-Frame-Options       "SAMEORIGIN"         always;
  add_header X-Content-Type-Options "nosniff"            always;
  add_header Strict-Transport-Security "max-age=31536000" always;

  # Gzip
  gzip          on;
  gzip_types     text/html text/css application/javascript;

  # Static caching
  location ~* \.(jpg|png|svg|ico|css|js)$ {
    expires 30d;
    access_log off;
  }

  location / {
    try_files $uri $uri/ =404;
  }
}